Hi,
Need some help to figure out why I am getting this error message.
"run time error 1004,
unable to set the numberformat property of the range class"
I have recorded a macro to run a time duration of a game.
Cell A1 Start time 15:35
Cell A2 End time (click button to run the macro, see below)
Cell A3 Time difference fromula (=A2-A1) This cell is formated to [mm]
Everything works great, when the sheet is not protected.
When I protect the sheet, I get the error message.
[Note:
Without the Macro and the button and with the sheet protected, I use the Ctrl+Shift+: keys to record the End time. It works fine.]
Macro:
Sub GameDuration()
ActiveCell.FormulaR1C1 = Now()
Selection.NumberFormat = "h:mm"
ActiveCell.Offset(2, 0).Select
End Sub
Any help in solving the above would be very much appreciated.
Thanks
FLDS
Need some help to figure out why I am getting this error message.
"run time error 1004,
unable to set the numberformat property of the range class"
I have recorded a macro to run a time duration of a game.
Cell A1 Start time 15:35
Cell A2 End time (click button to run the macro, see below)
Cell A3 Time difference fromula (=A2-A1) This cell is formated to [mm]
Everything works great, when the sheet is not protected.
When I protect the sheet, I get the error message.
[Note:
Without the Macro and the button and with the sheet protected, I use the Ctrl+Shift+: keys to record the End time. It works fine.]
Macro:
Sub GameDuration()
ActiveCell.FormulaR1C1 = Now()
Selection.NumberFormat = "h:mm"
ActiveCell.Offset(2, 0).Select
End Sub
Any help in solving the above would be very much appreciated.
Thanks
FLDS