I am checking Time spans on a spreadsheet like in times sheets. Many span both shifts day and night.
I used the Mod(C2-B2,1) format cell [h]:mm
What I am tiring to do is create vba macro which will prompt me for the first cell then second cell for the Mod formula and answer would show me in a message box this answer would have to be formatted [H]:mm
My first attempt was this.
Problem is the cells are not always aligned.
any suggestion as to the best way?
Thanks
I used the Mod(C2-B2,1) format cell [h]:mm
What I am tiring to do is create vba macro which will prompt me for the first cell then second cell for the Mod formula and answer would show me in a message box this answer would have to be formatted [H]:mm
My first attempt was this.
Code:
Sub CheckTime()'
' CheckTime Macro
ActiveCell.Offset(0, -3).Range("D1,B1,A1,D1").Select
Selection.FormulaR1C1 = "=MOD(RC[-2]-RC[-3],1)"
End Sub
Problem is the cells are not always aligned.
any suggestion as to the best way?
Thanks