Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-03-2020, 02:28 AM
eduzs eduzs is offline Set variable word field Windows 10 Set variable word field Office 2019
Expert
Set variable word field
 
Join Date: May 2017
Posts: 260
eduzs is on a distinguished road
Default Set variable word field

This field code returns a date:



{ QUOTE { SET Delay -1 } { SET m { =MOD({ DATE \@ MM }+Delay+11;12)+1 } }{ SET y { =INT({ DATE \@ yyyy }+(Delay+{ DATE \@ M }-1)/12) } } “{ m }-{ y }” \@ “MMM/yy” }

But, instead of "QUOTE" show the date, I need to set a variable with this date.
How to set a variable instead of show the date?

Something like (which does not works):

{ SET DateX { QUOTE { SET Delay -1 } { SET m { =MOD({ DATE \@ MM }+Delay+11;12)+1 } }{ SET y { =INT({ DATE \@ yyyy }+(Delay+{ DATE \@ M }-1)/12) } } “{ m }-{ y }” \@ “MMM/yy” } }

So, if elsewhere in the document I want to see the date, I just insert a field:

{ DateX }

Ps.: please move this topic to WORD , sorry.

Thanks
Reply With Quote
  #2  
Old 09-03-2020, 10:08 AM
eduzs eduzs is offline Set variable word field Windows 10 Set variable word field Office 2019
Expert
Set variable word field
 
Join Date: May 2017
Posts: 260
eduzs is on a distinguished road
Default

With a lot of work I managed to do:

{ SET Delay -1 } { SET m { =MOD({ DATE \@ MM }+Delay+11;12)+1 } }{ SET y { =INT({ DATE \@ yyyy }+(Delay+{ DATE \@ M }-1)/12) } }{ SET MyDate "1/{ m }/{ y }" }{ MyDate \@ "d/M/yyyy" }

Thanks all!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to create a bar chart of multiple variable. Then I need to draw trend lin of those variable shimulsiddiquee Excel 1 05-16-2017 07:39 AM
Set variable word field Variable text field code based on occurrences on each page Cosmo Word 2 12-29-2015 11:54 AM
Run Time Error '91': Object variable or With block variable not set using Catalogue Mailmerge Berryblue Mail Merge 1 11-13-2014 05:36 PM
Set variable word field Run-time error 91 object variable or with block variable not set JUST ME Word VBA 4 03-25-2014 06:56 AM
Set variable word field Run-time error '91': Object variable or With block variable not set tinfanide Excel Programming 2 06-10-2012 10:17 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:41 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