LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Activate a moacro subroutine from a userform command button

Hi,

Private Sub CommandButton1_Click()
Call DateStamp
End Sub

Mike

"Roger on Excel" wrote:

[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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
print command from command button in userform causes double chart Mike Jamesson Excel Programming 5 August 11th 09 03:42 AM
How to activate command button on form by macro Denis[_4_] Excel Programming 2 October 24th 08 08:59 PM
Calling a subroutine with a command button JonV Excel Programming 2 July 7th 08 10:45 PM
button to activate userform Virginia[_2_] Excel Programming 2 August 15th 04 10:27 PM
using 'enter' on a textbox to activate a command button? neowok[_23_] Excel Programming 1 February 25th 04 12:25 PM


All times are GMT +1. The time now is 11:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"