Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
obtaining the name of a button
If you have assigned a macro to a shape - say a button from the form bar - and you then activate the macro by clicking on the button, doe anyone know the code to obtain the name of the button you clicked on ? I think it should be along the lines of: but_name = Activesheet.shapes.selection.name but of course that doesn't work ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com ~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
obtaining the name of a button
Application.Caller will return the name of the shape that called
the macro. E.g., MsgBox Application.Caller -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "jmoffat" wrote in message ... If you have assigned a macro to a shape - say a button from the forms bar - and you then activate the macro by clicking on the button, does anyone know the code to obtain the name of the button you clicked on ? I think it should be along the lines of: but_name = Activesheet.shapes.selection.name but of course that doesn't work. ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ ~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
obtaining the name of a button
but_Name = Application.Caller
-- Regards, Tom Ogilvy "jmoffat" wrote in message ... If you have assigned a macro to a shape - say a button from the forms bar - and you then activate the macro by clicking on the button, does anyone know the code to obtain the name of the button you clicked on ? I think it should be along the lines of: but_name = Activesheet.shapes.selection.name but of course that doesn't work. ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ ~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Problems Obtaining Data | Excel Discussion (Misc queries) | |||
Obtaining just the Year out of the date | Excel Discussion (Misc queries) | |||
Obtaining sum for multiple criteria | Excel Discussion (Misc queries) | |||
Obtaining Max and Min Values with Sumproduct | Excel Discussion (Misc queries) | |||
obtaining data from Access | Excel Programming |