Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
click buttons to do, re-click to un-do
Hello all,
I would like to add a button in a spreadsheet and have it do a operation when cliked and undo the same operation when clicked again. how do I do this? Could someone help me write the code? Thank -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
click buttons to do, re-click to un-do
Hi
one way: Declare a static variable. e.g. ---- Private Sub CommandButton1_Click() Static status As Boolean If status Then ' your code for undoing something CommandButton1.Caption = "Do something" status = False Else ' your code for doing something CommandButton1.Caption = "Undo something" status = True End If End Sub -- Regards Frank Kabel Frankfurt, Germany Hello all, I would like to add a button in a spreadsheet and have it do an operation when cliked and undo the same operation when clicked again. how do I do this? Could someone help me write the code? Thanks --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
click buttons to do, re-click to un-do
Add a checkbox instead of a button and test its value for True/False
-- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "arciduca79 " wrote in message ... Hello all, I would like to add a button in a spreadsheet and have it do an operation when cliked and undo the same operation when clicked again. how do I do this? Could someone help me write the code? Thanks --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
My Buttons shrink with every click | Excel Worksheet Functions | |||
I click on something and my Macro buttons disappered. Help. | New Users to Excel | |||
Control toolbox Buttons disappear on click | Excel Discussion (Misc queries) | |||
Click on graph bar to execute a double-click in a pivot table cell | Charts and Charting in Excel | |||
edit the buttons in right click menu | Excel Worksheet Functions |