View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\) Rick Rothstein \(MVP - VB\) is offline
external usenet poster
 
Posts: 2,202
Default COMPARE TODAY WITH DATE IN COLUMN

I want to compare today date with date in a column (column name:
"date_last_op") and fill the bar chart with pattern if 3 days but alway
have error at
Set Rng2.Value = (DateDiff(TODAY, "date_last_op", "d"))

Don't know how to fix. Need your help. Please respond with your sugestion


You are trying to use Excel worksheet function ordering on the VBA DateDiff
function... they are not the same... as well as a worksheet function (TODAY)
which doesn't exist in VBA The first argument in DateDiff is the Interval,
then the start (lowest) date, followed by the end (highest) date. Also,
TODAY does not exist in VBA... use either Date (which returns today's date
only) or Now (which returns today's date and time).

Rick