ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   dynamic buttons (https://www.excelbanter.com/excel-programming/290121-dynamic-buttons.html)

Noctos[_17_]

dynamic buttons
 
I was wondering if it was possible to change the macro assigned to
button by linking it to the cell link value of an option button. Fo
instance if the user chose "yes" macro 1 will be assigned to a button
If they chose "No" macro 2 will be assigned to the button

--
Message posted from http://www.ExcelForum.com


Bob Phillips[_6_]

dynamic buttons
 
Hi Noctos,

Yes it is. This assigns MacroB to a button

ActiveSheet.Shapes("Button 1").OnAction = "MacroB"



--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Noctos " wrote in message
...
I was wondering if it was possible to change the macro assigned to a
button by linking it to the cell link value of an option button. For
instance if the user chose "yes" macro 1 will be assigned to a button.
If they chose "No" macro 2 will be assigned to the button.


---
Message posted from http://www.ExcelForum.com/




Harald Staff

dynamic buttons
 
No (=not in a simple, safe way worth considering, almost everything is possible).

Let the button macro consider what the user has selected and call the proper macro.

--
HTH. Best wishes Harald
Followup to newsgroup only please.

"Noctos " wrote in message
...
I was wondering if it was possible to change the macro assigned to a
button by linking it to the cell link value of an option button. For
instance if the user chose "yes" macro 1 will be assigned to a button.
If they chose "No" macro 2 will be assigned to the button.


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 03:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com