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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Attach macro to Command Button in Excel

Status
Not open for further replies.

Ericthemapper

Technical User
Feb 18, 2003
7
IN
I want to be able to attach a macro to a command button in excel and then make the button (with macro behind it) into a add-in for excel (a XLA file). There were several threads regarding creating Add-INs but for us, Novice programmers, they were too over my head!!

Any suggestions or commentions would be help!!


 
Just write your code in a workbook's VBA project, and save that workbook as an AddIn (Save As, choose Excel Addin from the dropdown list). Then you can install the AddIn so it will always be loaded when Excel loads.
Rob
[flowerface]
 
I can do that part, but I want to be able to add the macro to a command button. So when I give this 'add in' to another user in my office, it will come up with the button, they press the button and the macro executes.

When I create a command button, it asks for the maco name, I notice that its has the workbookname and then the modulename. This is where I am confused as to the naming convention of a Add-In button
 
An AddIn per definition has no visible worksheets - and therefore no place to put a commandbutton. You can attach the addin macro to a toolbar button: either an existing toolbar or a custom one. Is that what you're trying to do?
Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top