MarkOz
08-29-2018, 02:11 AM
Hi all
Fist time here and hoping someone can help. I've just spent hours googling and have had no luck.
I have an Excel worksheet which contains cumulative hours worked.
I have a VBA form where user enters next shift information.
I need to pull the current shift total into VBA (I have to display the current value - which may be zero or greater - as well as the new value when I add the shift duration). The issue is that I am able to format the cell show it displays as an actual "hour value" using [h]:mm format and it's all good where the shift total is under 24 hours (probably 23:39)
However, when the value is 24 or more when I pull it into my module using the following code:
dteCurrentShiftTotal1 = wsCurrent.Cells(UseRow, intDay1Col).Value
[Declarations - dteCurrentShifttotal1 as date, wsCurrent as worksheet, UseRow and intDay1Col are Integers]
... it comes in as a date/time - e.g. if the display value is 27:00 in the cell, dteCurrentShiftTotal1 is assigned a value of 1/01/1900 3:00:00 AM
The issue is I don't know how to determine if it is meant to be 3:00 hours shift total, 27:00 or even 51:00.
Can someone advise me please?
Cheers
mark
Fist time here and hoping someone can help. I've just spent hours googling and have had no luck.
I have an Excel worksheet which contains cumulative hours worked.
I have a VBA form where user enters next shift information.
I need to pull the current shift total into VBA (I have to display the current value - which may be zero or greater - as well as the new value when I add the shift duration). The issue is that I am able to format the cell show it displays as an actual "hour value" using [h]:mm format and it's all good where the shift total is under 24 hours (probably 23:39)
However, when the value is 24 or more when I pull it into my module using the following code:
dteCurrentShiftTotal1 = wsCurrent.Cells(UseRow, intDay1Col).Value
[Declarations - dteCurrentShifttotal1 as date, wsCurrent as worksheet, UseRow and intDay1Col are Integers]
... it comes in as a date/time - e.g. if the display value is 27:00 in the cell, dteCurrentShiftTotal1 is assigned a value of 1/01/1900 3:00:00 AM
The issue is I don't know how to determine if it is meant to be 3:00 hours shift total, 27:00 or even 51:00.
Can someone advise me please?
Cheers
mark