Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Button & Code question
I have a workbook with a Master and Summary sheet.
It will become a Template, (or perhaps read only xls). Buttons on the Master allow the user to do simple things like add a sheet, reorder sheets, etc. When they add a sheet via the button on the Master, I'd like to copy a hidden button from the Master, and place it on the new sheet (including the code). Can I do this, and if so, how, please? Regards. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Button & Code question
Easier to have the generalized code in a general module and use a button
from the forms toolbar. then you just add it (macro recorder) and assign it to the macro. (OnAction property). In the generalized code Sub General_Button_Click() sName = Application.Caller btn = Activesheet.Buttons(sName) msgbox btn.Caption End Sub Or http://www.cpearson.com/excel/vbe.htm and the macro recorder shows how to copy or add a commandbutton. (why copy - just add it and format it as you wish with code). -- Regards, Tom Ogilvy "Stuart" wrote in message ... I have a workbook with a Master and Summary sheet. It will become a Template, (or perhaps read only xls). Buttons on the Master allow the user to do simple things like add a sheet, reorder sheets, etc. When they add a sheet via the button on the Master, I'd like to copy a hidden button from the Master, and place it on the new sheet (including the code). Can I do this, and if so, how, please? Regards. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Button & Code question
Thanks for the code and guidance.
Regards. "Tom Ogilvy" wrote in message ... Easier to have the generalized code in a general module and use a button from the forms toolbar. then you just add it (macro recorder) and assign it to the macro. (OnAction property). In the generalized code Sub General_Button_Click() sName = Application.Caller btn = Activesheet.Buttons(sName) msgbox btn.Caption End Sub Or http://www.cpearson.com/excel/vbe.htm and the macro recorder shows how to copy or add a commandbutton. (why copy - just add it and format it as you wish with code). -- Regards, Tom Ogilvy "Stuart" wrote in message ... I have a workbook with a Master and Summary sheet. It will become a Template, (or perhaps read only xls). Buttons on the Master allow the user to do simple things like add a sheet, reorder sheets, etc. When they add a sheet via the button on the Master, I'd like to copy a hidden button from the Master, and place it on the new sheet (including the code). Can I do this, and if so, how, please? Regards. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Code for my Command Button to automatically copy and insert a new | Excel Discussion (Misc queries) | |||
Command Button Code to copy data | Excel Programming | |||
Code to copy range vs Copy Entire Worksheet - can't figure it out | Excel Programming | |||
copy to sheet code question | Excel Programming | |||
Copy form and code question | Excel Programming |