![]() |
#1
|
|||
|
|||
![]()
Hi I have a word document that is used for documenting corrective actions issued against various departments at work. The document as it has been created has a table. In the table is an entry with the text "Date Raised:" I need to add some VBA code that(on document open) will identify the correct table cell, make it active, insert the current date. I will be adding another cell to an existing table in another section of the document that will have to populate with a date that is 30 days forward of the date that was inserted when the code triggers to add current date.
In Excel I would create my if then else and use date() to insert the current date. Thanks for your help. Mel ![]() |
#2
|
|||
|
|||
![]()
Well I would hope that you are doing it as a real template, rather than a document open. After all, if the document is opened again, then the code will run again...thus changing the date. Surely this is not what you want.
If it was a template, using Document_New (not open), then the date would go in once (and only once). That aside, you probably do not need to "activate" the cell - there is no activate BTW. Perhaps use a bookmark. In which case the current date could be inserted at the bookmark. You could do this directly, with no need to "activate". This could also add 30 days to another bookmark value. BTW: is the text "Date Raised:" already in the cell? |
#3
|
|||
|
|||
![]()
fumei thanks for the response. Actually the document will be stored on the intranet so I do want it to put the current date in it everytime it is opened. We don't want users to open and edit already created documents since there have been mistakes where instead of using save as they have used save which then loses the document trail and goofs up the file naming convention. The date raised cell is not populated and there will be code to check to see if one already exists, if so the document will protect to disallow edits forcing the person to go on the intranet and use the blank document. I will look at bookmarks and see what I can find. I tried just creating a macro, but once it is started it disallows clicking in the date raised cell to do any more with.
Regards, Mel |
#4
|
|||
|
|||
![]()
So where is "Date Raised:" ? In a different cell?
Honestly, I am not really up to snuff on files coming from an intranet; what is allowed, what is not. I am not sure that a real template is still not the way to go. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
theMikeD | Word | 2 | 09-11-2012 05:46 PM |
![]() |
ketanco | Project | 1 | 02-08-2012 02:20 PM |
![]() |
GatorFan1 | Excel | 2 | 12-02-2011 09:33 PM |
How to count year lapse (rounded off) based on specific date | KIM SOLIS | Excel | 1 | 11-01-2011 10:50 AM |
How can I make a cell color RED under the Today's date cell? | Learner7 | Excel | 2 | 07-08-2010 12:52 AM |