VBA: comparing dates

mkingrey

New Member
Joined
Nov 2, 2005
Messages
49
I am using VB a program that runs a loop to compare dates in two adjacent columns and peforms actions based on the boolean value returned. This code seems to work perfectly except whenever a date on the 9th day of a given month is compared with another date, its boolean value returned is incorrect. The code itself seems to be fine so I did not include it here, so it has to be related to the data or data type.

this is what my VBA tells me

Exp:

06/10/05 > 06/09/05 = False
07/11/05 > 07/09/05 = False
however if the months it runs correctly
07/01/05 > 06/09/05 = True


Anyone know why the 9th day of the month is always greater the all other days in the month?
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
is the example that should say, "however if the months are different then it runs correctly." - sorry
 
Upvote 0

Forum statistics

Threads
1,213,549
Messages
6,114,264
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top