Link to home
Start Free TrialLog in
Avatar of Patricia Timm
Patricia TimmFlag 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
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

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

Avatar of Bill Prew
Bill Prew

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Patricia Timm


Avatar of Bill Prew
Bill Prew

Welcome, glad that helped.

Or TODAY function gives just the current date: