sdwards
02-23-2011, 04:19 PM
Ok, give up :banghead:
I'm trying to copy a value from a table depending on the time. So simply table is (r=row, c=column):
....1....................2..............3
1 Date..............Time..........Cost
2 11/11/2007...23:59:00.......$40
3 11/12/2007...00:00:00.......$40
(Obviously without the full stops)
I have a statement:
If Cells(r,2)<Cells(r+1,2) then
Copy.Cells blah blah blah
VB is reading the cell(3,2) < cell(2,2) since excel is taking the numeric value, I think. The problem is, I don't know how to make VB realise cell(3,2) > cell(2,2) since this is the next day. I have gone through all the objects in the DateTime and but to no avail. :help
Help would be much appreciated,
Scott
I'm trying to copy a value from a table depending on the time. So simply table is (r=row, c=column):
....1....................2..............3
1 Date..............Time..........Cost
2 11/11/2007...23:59:00.......$40
3 11/12/2007...00:00:00.......$40
(Obviously without the full stops)
I have a statement:
If Cells(r,2)<Cells(r+1,2) then
Copy.Cells blah blah blah
VB is reading the cell(3,2) < cell(2,2) since excel is taking the numeric value, I think. The problem is, I don't know how to make VB realise cell(3,2) > cell(2,2) since this is the next day. I have gone through all the objects in the DateTime and but to no avail. :help
Help would be much appreciated,
Scott