Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all, looking for some help. I'm trying to use a For loop to look through a list of dates in a worksheet and flag cells whose dates are greater than 100 days.
Set Date_Range = Sheets("Sheet1").Range("A1:A500") YearStartDate = DateSerial(2014, 1, 1) For Each DateVal In Date_Range DateAge = DateVal - YearStartDate If DateAge 100 Then MsgBox DateVal.Address & "is greater than 100 days End If Next DateVal The code gives an error. Is it because DateVal and YearStartDate are different data types? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Writing the result of arithmetic calculation in a cell | Excel Programming | |||
About arithmetic Formulas | Excel Discussion (Misc queries) | |||
CurrentDate + 3 months (arithmetic with dates???) | Excel Programming | |||
bad arithmetic | Excel Programming | |||
Formatting cell and doing date arithmetic | Excel Programming |