Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am just into vb macro. so Could anybody please help me out! I want to
know comparison of two dates of excel in macro, since there is mismatch of formats (EXCEL :DD-MM-YY & VB:mm/dd/yy) Could you help me coding - how to compare two dates in Macro. Suppose A1 contains 28-11-00. I want to check whether the value in A1 is LESS THAN 02-3-01 and greater than or equal to 16-12-98 . Thanking you in anticipation With regards -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200908/1 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this:
Print Range("A1") < DateSerial(2001, 3, 2) And Range("A1") = DateSerial(1998, 12, 16) Regards, Stefi €˛lataa3 via OfficeKB.com€¯ ezt Ć*rta: I am just into vb macro. so Could anybody please help me out! I want to know comparison of two dates of excel in macro, since there is mismatch of formats (EXCEL :DD-MM-YY & VB:mm/dd/yy) Could you help me coding - how to compare two dates in Macro. Suppose A1 contains 28-11-00. I want to check whether the value in A1 is LESS THAN 02-3-01 and greater than or equal to 16-12-98 . Thanking you in anticipation With regards -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200908/1 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
To compare apples with apples, You may want to try something like this:
result = CDate(Range("A1")) CDate("28-11-00") With regards Mishell "lataa3 via OfficeKB.com" <u54234@uwe wrote in message news:9b5051159aa75@uwe... I am just into vb macro. so Could anybody please help me out! I want to know comparison of two dates of excel in macro, since there is mismatch of formats (EXCEL :DD-MM-YY & VB:mm/dd/yy) Could you help me coding - how to compare two dates in Macro. Suppose A1 contains 28-11-00. I want to check whether the value in A1 is LESS THAN 02-3-01 and greater than or equal to 16-12-98 . Thanking you in anticipation With regards -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200908/1 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Aug 29, 11:27*am, "lataa3 via OfficeKB.com" <u54234@uwe wrote:
I am just into *vb macro. so Could anybody please help me out! * I want to know comparison of two dates of excel in macro, *since there is mismatch of formats (EXCEL :DD-MM-YY & VB:mm/dd/yy) Could you help me coding *- how to compare two dates in Macro. Suppose A1 *contains *28-11-00. * I want to check *whether the value in A1 is LESS THAN * 02-3-01 and greater than or equal to 16-12-98 *. Thanking you in anticipation With regards -- Message posted via OfficeKB.comhttp://www.officekb.com/Uwe/Forums.aspx/excel-programming/200908/1 You can use GemBox.Spreadsheet: http://www.gemboxsoftware.com/GBSpreadsheet..htm It can read different date formats, convert it to one and then easily compare |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Comparing Excel Dates | Excel Worksheet Functions | |||
Comparing 2 Dates | Excel Worksheet Functions | |||
Excel 2007 comparing dates | Excel Discussion (Misc queries) | |||
Comparing Dates | Excel Discussion (Misc queries) | |||
simple help with comparing dates in excel | Excel Programming |