Skip to main content

Create a Button That Enters the Current Time

 

 

  1. Save the workbook as an XLSM (Macro enabled) document first.
  2. Ensure the Developer tab in the ribbon bar is enabled (enable if it's not via File/Options/Customize Ribbon/Check the box for Developer) and open Visual Basic.
  3. Create a button via the Developer Ribbon/Insert/Form Controls/Button.
  4. Create somewhere on the sheet you'd like the button to be visible and customize size/shape/text.
  5. Once in Visual Basic, paste the below script.

    Sub Nowtime()
    
    ActiveCell.Value = Now()
    
    End Sub

  6. Assign the VBScript to the button you created previously.