Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In VBA, I want to compare an input date (mm/dd/yy) with the current system
date and return either positive (input date prior to current date) or negative (input date precedes current date) days. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
'declare variables Dim dat As Date Dim days As Integer 'enter date as text, change to date format and save in variable dat dat = CDate(InputBox("Enter Date (mm/dd/yy)")) 'subtract entered date from systemdate and save result in variable days days = Date - dat Regards Ingolf |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you! I have implemented it and it works.
"Ingolf" wrote: Hi, 'declare variables Dim dat As Date Dim days As Integer 'enter date as text, change to date format and save in variable dat dat = CDate(InputBox("Enter Date (mm/dd/yy)")) 'subtract entered date from systemdate and save result in variable days days = Date - dat Regards Ingolf |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Date Comparison | Excel Discussion (Misc queries) | |||
date comparison | Excel Discussion (Misc queries) | |||
Date comparison | Excel Worksheet Functions | |||
date comparison help | Excel Discussion (Misc queries) | |||
Date comparison | Excel Worksheet Functions |