Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-22-2021, 11:06 PM
gmayor's Avatar
gmayor gmayor is offline Add the value of a cell in the table to another cell Windows 10 Add the value of a cell in the table to another cell Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,144
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

Your explanation was simple enough before, but what you require is not as simple as you imagine. For example, if you refer to the document I linked the field construction required to add 3 days to the current date is



{QUOTE
{SET Delay 3}
{SET a{=INT((14-{DATE \@ M})/12)}}
{SET b{={DATE \@ yyyy}+4800-a}}
{SET c{={DATE \@ M}+12*a-3}}
{SET d{DATE \@ d}}
{SET jd{=d+INT((153*c+2)/5)+365*b+INT(b/4)-INT(b/100)+INT(b/400)-32045+Delay}}
{SET e{=INT((4*(jd+32044)+3)/146097)}}
{SET f{=jd+32044-INT(146097*e/4)}}
{SET g{=INT((4*f+3)/1461)}}
{SET h{=f-INT(1461*g/4)}}
{SET i{=INT((5*h+2)/153)}}
{SET dd{=h-INT((153*i+2)/5)+1}}
{SET mm{=i+3-12*INT(i/10)}}
{SET yy{=100*e+g-4800+INT(i/10)}}
"{mm}-{dd}-{yy}" \@ "MM/dd/yyyy"}


You cannot simply add 3 to the date or (say) 30th December + 3 would be 32nd December.
You can insert date fields that will give the required values for today's date for the three dates (see attached), but it will not work with typed text dates. You cannot calculate text dates in this manner in a Word table.
If you are not using date fields, the macro approach is still the most sensible option here.






Attached Files
File Type: docx Question3.docx (40.3 KB, 7 views)
__________________
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
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Add the value of a cell in the table to another cell Wish to delete letters to the right of the cursor in a Table cell, but whole cell is being deleted vjvj123 Word VBA 12 09-27-2018 03:09 PM
Add the value of a cell in the table to another cell Clear all cell colors within a range starting at cell A8 and change row of active cell to yellow FUGMAN Excel Programming 7 02-05-2017 08:37 AM
Pasting text from Excel cell into word without creating a table, and keeping the in-cell formatting hanvyj Excel Programming 0 08-28-2015 01:15 AM
Add the value of a cell in the table to another cell Table with text that flows from cell to cell hwrigley Word Tables 7 02-18-2014 02:59 AM
Auto-populate an MS Word table cell with text from a diff cell? dreamrthts Word Tables 0 03-20-2009 01:49 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:25 PM.


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