Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Comparing Dates - Flawed Code?
Afternoon all, I have a macro that compares dates but no matter what i try it doesn' seem to work. Simply it goes a little like: Dim cellDate 'Date that is in a certain cell 'format DD/MM/YYYY HH:MM. cellDate = Cells(row, col) 'Varies depending on previous actions. Dim formatDate 'cellDate formatted 'into same as i want to compare it to. formatDate = Format(cellDate, "dd/mm/yyyy") If formatDate = "01/10/2005" Then If formatDate <= "31/10/2005" Then End If End If I have tried initialising the variable as dates, strings, variants, bu none of the comparing IF statements work??? Any Help? Thanks in advance -- br_turnbul ----------------------------------------------------------------------- br_turnbull's Profile: http://www.excelforum.com/member.php...fo&userid=2747 View this thread: http://www.excelforum.com/showthread.php?threadid=47820 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
comparing dates with code | Excel Discussion (Misc queries) | |||
Flawed scatter plot function | Charts and Charting in Excel | |||
Comparing Dates | Excel Discussion (Misc queries) | |||
comparing two dates and executing code on condition | Excel Discussion (Misc queries) | |||
Flawed Macro | Excel Programming |