Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How create a button to record a macro in userform

Status
Not open for further replies.

thanhthanh12

Technical User
Nov 9, 2022
9
VN
I had a userform, i created a button in the userform. How can i click the button then a macro will start record? Thank you very much!
 
I took it as thanhthanh12 wants to create his own 'record a macro' button on the form and instead of using a button on the ribbon, he wants to click his own button.

If that's the case, I would like to know - why?

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
The problem is that [tt]Application.CommandBars.GetEnabledMso("MacroRecordOrStop")[/tt] returns false, otherwise [tt]Application.CommandBars.ExecuteMso("MacroRecordOrStop")[/tt] would start the recorder.
Anyway, if the userform is shown modeless, there is a full access to ribbon and simple:
dhookom said:
Isn’t there already a button on the ribbon for this?
works perfectly.

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top