ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macros (https://www.excelbanter.com/excel-programming/293163-re-macros.html)

JE McGimpsey

Macros
 
one way:

Put it in a regular code module (Insert/Module in the VBE).

Public Sub DateTimeButton_Click()
Worksheets("SLP Schedule").Range("P2").Value = Now
End Sub




In article ,
"Erik" wrote:

I have a sub in the thisworkbook code that places a date/time stamp in a cell
when the workbook is opened. How can I make this a macro and assign it a
button in the toolbar instead of it running on open?

Private Sub Workbook_Open()
Worksheets("SLP Schedule").Range("P2").Value = Now
End Sub



All times are GMT +1. The time now is 07:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com