Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #9  
Old 10-18-2013, 06:47 AM
BoringDavid BoringDavid is offline Calculating age of something from a Date Picker Windows XP Calculating age of something from a Date Picker Office 2010 32bit
Novice
Calculating age of something from a Date Picker
 
Join Date: Sep 2013
Posts: 19
BoringDavid is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
You have
Dim AgeofPlan As Date
but you're passing 'DateDiff(yyyy, TheDate, Now)' to it, which is a number, not a date.

To insert the content into the document, bookmark the destination, then use code like the attached.
The code in that attachment has gone straight over my head!

The destination is already bookmarked as 'Years1', I have no need for days or months being added, just the year (with no additional content), which will be inserted into the bookmark 'Years1' that is already in a sentence in the document, however, this is all dependent upon a series of logic arguments. Therefore, I need the age to be set as an expression in the same manner that I set the start date (b = Format(Me.DTPStartDate.Value, "d MMMM yyyy"), although in this case I want it to be "c").
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Default dates for a Date Picker BoringDavid Word VBA 2 09-11-2013 01:42 AM
Calculating age of something from a Date Picker Date Picker Andy2011 Word VBA 4 11-24-2012 10:07 PM
Calculating age of something from a Date Picker word 2003 date picker nashville Word 16 04-06-2012 04:12 AM
Date picker trintukaz Excel 0 12-30-2011 12:42 AM
Calculating age of something from a Date Picker Calculating age at date jamierbooth Excel 2 02-22-2011 03:35 AM

Other Forums: Access Forums

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