LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
comparing dates with code Jack Sons Excel Discussion (Misc queries) 2 September 1st 09 09:47 PM
Flawed scatter plot function wigner Charts and Charting in Excel 2 January 26th 08 02:57 AM
Comparing Dates fubdap Excel Discussion (Misc queries) 3 September 27th 07 03:53 PM
comparing two dates and executing code on condition ashish128 Excel Discussion (Misc queries) 4 August 31st 06 10:45 AM
Flawed Macro Nathan Bell Excel Programming 1 September 10th 04 03:08 AM


All times are GMT +1. The time now is 08:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"