#1
|
|||
|
|||
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 |
#2
|
||||
|
||||
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.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
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 |
#4
|
||||
|
||||
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.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#5
|
|||
|
|||
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 |
#6
|
||||
|
||||
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 |
#7
|
||||
|
||||
Quote:
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 |
|
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 |
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 |
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 |