"Resetting" - Macros

MrStudentCBS

New Member
Joined
Dec 31, 2013
Messages
2
Hey i'll try to keep it simply, i'm new to VBA and as thus i'm making a sheet, complicating myself, in every way i possibly can, to learn the different ways of, well for now just VBA.

I've built an easy to understand budget sheet, with a series of macros, activating their own buttons, with macros already assigned to them. But i'm coming to trouble, as the sheet is meant to be for people, with little knowledge of how taxes and budget sheets are to be made and calculated.
So i'm in need of a way to make a "reverse step button", which can reverse the last step. (Thus if the last step was to input Wage, and a selection of rows names etc, the next button, would reverse this, going back to the last step, removing all the text and wages input by the last macro.)

Next i've made another button, which reverses the whole thing. The only trouble i'm having is, that i need a way to clear buttons, but overlooking Formats and overlooking the button itself (Lets call the button "Reset").

Hoping that some of the minds out there, has got an idea to solve these problems.

For names of macros. Refer to the first macro inserting values would be "Macro1", the one reversing would be "Macro2", the one resetting the whole thing, would be "Reset". :)
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
You don't say if it a forms button or an ActiveX button. If it is a forms button then try the code below.

Code:
Sub DeleteButton()
    Dim DelButt As Shape
    For Each DelButt In ActiveSheet.Shapes
        If DelButt.Type = 8 And DelButt.Name <> "Reset" Then DelButt.Delete
    Next DelButt
End Sub

But make sure you test it on a copy of your sheet
 
Upvote 0
Should have said that if by "clear" you mean hide the buttons then you can use Visible = False

Code:
Sub HideButton()
    Dim DelButt As Shape
    For Each DelButt In ActiveSheet.Shapes
        If DelButt.Type = 8 And DelButt.Name <> "Reset" Then DelButt[COLOR="#FF0000"].Visible = False[/COLOR]
    Next DelButt
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top