What Im trying to do is. I column 6 I have time (like; 08:00, 23:00 etc). I want to use an dateadd "h" to control if any values are bigger then 07:00.
So what I basicly do is:
If DateAdd("h", 1, sheet1.Cells(I, 6)) * 24) - 7> "" Then
Because f I need to convert the time to decimal. If the time in column 7 is: 07:30 I want it to write:0,5 (07:30 - 07:00 (see sub in if-statement)).
I think your problem is that the data in column 6 is a date - although it might look like a time on the surface so you are multiplying that date by 24 not just the time element
Thanks for the answer but I cant get it work , the script is running OK now (b4 got error) but I don't get correct result. Have try in different ways but never comes in into the loop even when I have an time "bigger" then 07:00, have also try less then 07:00 then I got an Error.
When I used my If-statement I get the correct result after I format the cell but still got an error and can't run the whole sheet.