Activate a moacro subroutine from a userform command button

  • Thread starter Thread starter Roger on Excel
  • Start date Start date
R

Roger on Excel

[Excel 2003]

I use macros in a worksheet - for example:

Sub DateStamp()
Range("b14") = Date & " " & Time 'Date And Time
End Sub

I access the macro with a command button in the spreadsheet.

I would now like to access the same code using a command button on a Userform.

I guess I could repeat the same code in the command button on the userform,
but I would rather not duplicate the code.

Is there a way to do this?

Many thanks,

Roger
 
Back
Top