Avatar of Patricia Timm
Patricia Timm
Flag for United States of America asked on

Extracting the current date from the computer and comparing to a date in an excel spreadsheet

Is there a way to check the current date (on the computer - maybe system date - so it grabs the current date) and then compares to a date on an excel spreadsheet like a parts ordered date in the format 11/20/2019. Not sure if I can use excel formulas or if vb code would need to be used??? thanks in advance
VB ScriptMicrosoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
Rob Henson

8/22/2022 - Mon
Martin Liss

There may be a formula but this VBA  does something if the cell value is equal to or greater than 40 days prior to today
 
   If  DateDiff("d", wsRenew.Cells(lngRow, "B"), Now) >= 40 Then

Open in new window

ASKER CERTIFIED SOLUTION
Bill Prew

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Patricia Timm

ASKER
thanks!!
Bill Prew

Welcome, glad that helped.


»bp
Your help has saved me hundreds of hours of internet surfing.
fblack61
Rob Henson

Or TODAY function gives just the current date:

=TODAY()