Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-13-2019, 03:51 PM
bbhe bbhe is offline Search Doc for a specific text and then add number to another "cell" Windows 7 64bit Search Doc for a specific text and then add number to another "cell" Office 2013
Novice
Search Doc for a specific text and then add number to another "cell"
 
Join Date: Sep 2014
Posts: 5
bbhe is on a distinguished road
Default Search Doc for a specific text and then add number to another "cell"

Hi,
I really hope someone could help me out. I have 2 questions.

1: I have a word doc and would like to be able to automatically add a number.
Please see attached Template.doc
Is it possible to automatically add the number in the NUMBER column (according to the letter in the TEXT column.
If TEXT is A then the number in the NUMBER column should be 000001, etc..
The TEXT can be anything from A-U. Sometimes it is two letters. ec AB
In Excel I guess it could be done be conditional formatting... But it has to be in WORD.



2: Is it possible to have the DATE's inserted automatically when entering the WEEK number?

Sorry, I'm totally new to WORD and Visual Basic...
Any help is much appreciated

BR
Attached Files
File Type: docx Template.docx (12.8 KB, 6 views)
Reply With Quote
  #2  
Old 10-13-2019, 11:20 PM
gmayor's Avatar
gmayor gmayor is offline Search Doc for a specific text and then add number to another "cell" Windows 10 Search Doc for a specific text and then add number to another "cell" Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Word tables are not Excel, but you can achieve what you require with macros.
A-U is easy enough, but you have not indicated what happens when there are two characters. See attached

Create a new document from the template.
Attached Files
File Type: dotm Template.dotm (38.6 KB, 7 views)
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 10-14-2019, 02:23 AM
bbhe bbhe is offline Search Doc for a specific text and then add number to another "cell" Windows 7 64bit Search Doc for a specific text and then add number to another "cell" Office 2013
Novice
Search Doc for a specific text and then add number to another "cell"
 
Join Date: Sep 2014
Posts: 5
bbhe is on a distinguished road
Default

Wauwww just was I was looking for
I have added the two "letter" combination possible in new Template.
Is it possible that the formatting of the date can be dd/mm instead of dd-mm ?
And is it possible to hide the "Text x" in the TEXT column if no letter is added? (it looks wrong to me when I do a print )

It looks like the Macros missing after I have saved the new file (same format .dotm)

I really appreciate your help
Attached Files
File Type: dotm Template new.dotm (27.4 KB, 7 views)
Reply With Quote
  #4  
Old 10-14-2019, 04:29 AM
gmayor's Avatar
gmayor gmayor is offline Search Doc for a specific text and then add number to another "cell" Windows 10 Search Doc for a specific text and then add number to another "cell" Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The two modifications you suggest are simple enough - see attached
Click the red control to remove the placeholder texts from uncompleted fields.
Macros from templates don't travel with documents created from those templates. Save the document created from the template as DOCX format.
Attached Files
File Type: dotm Template.dotm (41.5 KB, 11 views)
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #5  
Old 10-14-2019, 08:56 AM
bbhe bbhe is offline Search Doc for a specific text and then add number to another "cell" Windows 7 64bit Search Doc for a specific text and then add number to another "cell" Office 2013
Novice
Search Doc for a specific text and then add number to another "cell"
 
Join Date: Sep 2014
Posts: 5
bbhe is on a distinguished road
Default

Is it possible that you could "import" it to this new doc (week.docx)?
I thought that I could do this myself, but I don't have the skills


And a final note. The Date seems to still be in dd-mm format and not dd/mm also after I click the red text
Attached Files
File Type: docx WEEK.docx (18.2 KB, 5 views)
Reply With Quote
  #6  
Old 10-14-2019, 07:49 PM
Guessed's Avatar
Guessed Guessed is offline Search Doc for a specific text and then add number to another "cell" Windows 10 Search Doc for a specific text and then add number to another "cell" Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

You can do the 'import' yourself by attaching the template to your document.

First, save the template to your Word User Templates folder. By default, this should be in the folder
%appdata%/Microsoft/Templates
You find that folder by pasting the above path into your Windows File Explorer folder path.

Then open the document in Word, show your Developer Tab and click on the Document Template button to attach the template.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #7  
Old 10-14-2019, 09:04 PM
gmayor's Avatar
gmayor gmayor is offline Search Doc for a specific text and then add number to another "cell" Windows 10 Search Doc for a specific text and then add number to another "cell" Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Quote:
Originally Posted by bbhe View Post
The Date seems to still be in dd-mm format and not dd/mm also after I click the red text
The date format is set in the line

oRng.Text = Format(DateAdd("ww", iNum - 1, DateSerial(Year(Now), 1, i)), "dd/mm")
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
extract email from google search "help" please " i can pay no problem after test" mohamedabdu Excel Programming 1 08-22-2018 07:43 PM
Convert Number to Text - To enter "AND" in between with different condition cltay87 Excel Programming 0 07-06-2018 12:56 AM
'Linking' entered information to other "cells" from an original "cell" in MS Word Wade Word 6 09-03-2012 05:22 PM
Search Doc for a specific text and then add number to another "cell" Mailing: how to make the "page number" in Word is the same as "row number" in excel w Jamal NUMAN Word 1 09-03-2011 11:37 AM
Search Doc for a specific text and then add number to another "cell" How can I paste cell "A1" contents to cell "B1" if cell "A1" is not blank? Learner7 Excel 1 04-25-2011 04:39 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:05 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft