![]() |
#1
|
|||
|
|||
![]()
Hi everyone,
I am using a drop down content control box with 3 values (A, B, C). Then I have a Date Control Control Box. Then I have a blank space that says "Review on ____(date)" I want to fill in the blank. Would someone be able to help me write a script that says something like: If Down Down Box = A, then take the "date" + 3 years, If = B then date +2 years, and if C then date = 3 years. otherwise do nothing? How do I go about doing this? I do not know how to code, and I'm hoping someone can help. Is there an easier way to do it? Thank you so much in advance! ![]() |
#2
|
|||
|
|||
![]()
I figured out I can use an If Word Field statement referencing the DropDown content box, however I don't know how to change the date to add 3 years in the If statement
{If {REF Dropbox} = "A" Date+3years nextIFstatement} Does anyone know how to change the Date+3 years? ![]() |
#3
|
||||
|
||||
![]()
Using fields with content controls won't give you an automatic update. See attached. Pressing Alt-F11 will reveal the VBA code used to drive the process.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
|||
|
|||
![]()
Thank you so much Macropod!! <3
SOLVED!! Last edited by Makingwork; 07-12-2022 at 10:45 AM. |
#5
|
|||
|
|||
![]()
I have one more question. Let's say I have 2 more boxes that I need the Date to copy to.
Is it possible to have the Date copied to multiple boxes? If I name them all "BoxesDate" only 1 updates. Sub UpdateBoxes(j As Long, StrDt As String) With ActiveDocument.SelectContentControlsByTitle("Boxes Date")(1) .LockContents = False If j = 0 Or StrDt = "" Then .Range.Text = "" Else .Range.Text = ActiveDocument.SelectContentControlsByTitle("Date" )(1).Range.Text) End If .LockContents = True End With End Sub |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
marna | Word VBA | 4 | 12-18-2018 07:20 PM |
![]() |
mike0215 | Word VBA | 3 | 11-17-2017 01:40 PM |
Macro for creating word docs from existing template | ferocious12 | Word VBA | 5 | 02-04-2017 09:57 PM |
help creating macro in word | cc.caroline15 | Word VBA | 10 | 02-23-2015 04:53 PM |
![]() |
tingker | Word VBA | 4 | 01-08-2015 08:58 PM |