Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 06-08-2016, 06:04 AM
gmayor's Avatar
gmayor gmayor is offline Linking 2 dates - change one it changes the other Windows 10 Linking 2 dates - change one it changes the other Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,142
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 ofgmayor has much to be proud of
Default

OK. Add the following to the ThisDocument module of the document

Code:
Option Explicit

Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
    If ContentControl.Title = "Issue Date" Then
        If Not ContentControl.Range.Text = ContentControl.PlaceholderText Then
            ActiveDocument.SelectContentControlsByTitle("Expiry Date").Item(1).Range.Text = _
            DateAdd("m", 12, CDate(ContentControl.Range.Text))
        End If
    End If
End Sub
Save the document as a macro enabled template and create new documents from it. As you tab out of the first date field the second one reflects 12 added months.
__________________
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking 2 dates - change one it changes the other How to change logo /dates in numerous word documents without changing each one individually? newi1 Word VBA 3 04-22-2016 07:02 PM
Autofill dates - how can I get the same date and consecutive dates? Exhale Excel 3 04-05-2016 03:11 AM
Linking 2 dates - change one it changes the other Linking dates in Headers and Footers lenoble22 Word 1 01-16-2014 12:20 PM
How to change dates automatically PaperBuster Word 5 09-24-2012 09:31 PM
How to change number format of dates ketanco Project 1 09-11-2012 02:34 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:56 AM.


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