ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Strange Condition on Date Value (https://www.excelbanter.com/excel-programming/450699-strange-condition-date-value.html)

[email protected]

Strange Condition on Date Value
 
Hi all

Am using Excel 2010 Macro

I had this condition which strangely holds TRUE for these values below:

CONDITION:
ElseIf Range("F" & z).Value Range("Q3").Value Then

VALUES
Range("F" & z).Value = 06-Jan-2015
Range("Q3").Value = 28-Feb-2015


This condition keep holding TRUE for the values. Is it not recognizing them as date values? If so, how do I force the condition to recognize them as date and thereby hold FALSE as expected.


GS[_2_]

Strange Condition on Date Value
 
Hi all

Am using Excel 2010 Macro

I had this condition which strangely holds TRUE for these values
below:

CONDITION:
ElseIf Range("F" & z).Value Range("Q3").Value Then

VALUES
Range("F" & z).Value = 06-Jan-2015
Range("Q3").Value = 28-Feb-2015


This condition keep holding TRUE for the values. Is it not
recognizing them as date values? If so, how do I force the condition
to recognize them as date and thereby hold FALSE as expected.


My v2010 returns 'False' for this!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



Claus Busch

Strange Condition on Date Value
 
Hi Kris,

Am Wed, 4 Mar 2015 03:32:32 -0800 (PST) schrieb :

Range("F" & z).Value = 06-Jan-2015
Range("Q3").Value = 28-Feb-2015


are that true dates?
If not try it with datevalue:
If DateValue(Range("F" & z)) DateValue(Range("Q3"))

Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional


All times are GMT +1. The time now is 06:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com