I am looping through several dates and my goal is, if the date is within the last 24 hours, then I want to sum a number corresponding to that date with all the other data from that day (to eventually find the average). However I am getting not getting what I expect using the comparison in VBA - the if statement is always true when I use a greater than comparison.
When I do a "=IF(H6>I6,1,0)" with the same dates as a sheet formula, it has the correct indication whether H6 is after I6 or not. The following code however does not give an equivalent:
Any help is appreciated.Please Login or Register to view this content.
Bookmarks