Via VBA I change the formatting of a cell. This cell is unprotected.
When I protect (Tools - protect) the sheet, I get an error when I start the VBA-code (macro).
Some code I wrote:
ActiveCell.Offset(1, 0).Activate
ActiveCell.Formula = Now()
Selection.NumberFormat = "h:mm:ss"
The last line gives the problem.
Is there a possibility to change the default formatting of the formula now(). It has to be "h:mm:ss"
Thanks in advance.
When I protect (Tools - protect) the sheet, I get an error when I start the VBA-code (macro).
Some code I wrote:
ActiveCell.Offset(1, 0).Activate
ActiveCell.Formula = Now()
Selection.NumberFormat = "h:mm:ss"
The last line gives the problem.
Is there a possibility to change the default formatting of the formula now(). It has to be "h:mm:ss"
Thanks in advance.