Forum Discussion
Shylyn
Aug 16, 2021Copper Contributor
Time Macros
I am trying to create a time sheet kinda workbook. I am wanting to set it up that when you click a button it will enter the current time. I need multiple buttons to do this to enter breaks, lunch, et...
- Aug 16, 2021
Instead of setting the formula of a cell to "=NOW()", set its value to Now. For example:
Sub SetTime() Range("D2").Value = Now End Sub
.
Shylyn
Aug 16, 2021Copper Contributor
I am using the NOW() function. I am not copying it for the other buttons, I was adding it to each button individually. I tried the copy/paste and figured that was the issue. I will try the Paste special and see if that works. I know very little about macros and I am trying to replace a workbook for my job.
HansVogelaar
Aug 16, 2021MVP
Instead of setting the formula of a cell to "=NOW()", set its value to Now. For example:
Sub SetTime()
Range("D2").Value = Now
End Sub
.
- ShylynAug 16, 2021Copper ContributorTHANK YOU SO MUCH! This is working just like I need it to.