ExcelBanter

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

ali

buttons???
 

I've created a macro which creates a worksheet containing a button whic
activates a second macro if selected. Everything is working well s
far! However I want the first macro to return the button with the nam
"update" - at present it returns a macro called button 2, button 3 et
which then crashes the second macro.

I can't find a way to do this? Can anyone help please

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com


Bill Manville

buttons???
 
Ali wrote:
However I want the first macro to return the button with the name
"update" - at present it returns a macro called button 2, button 3 etc
which then crashes the second macro.


Assuming that this is a Forms toolbar button then

With ActiveSheet.Buttons.Add(1, 2, 3, 4)
.Name = "Update"
.OnAction = "MyMacro"
End With

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup



All times are GMT +1. The time now is 06:42 PM.

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