"reset" macro

singingsister

Board Regular
Joined
Jun 13, 2006
Messages
145
I have a large spreadsheet with a variety of macro "buttons" to hide various columns to only show certain data. What I need is to create a "reset" button, that is to say for which ever macro button someone has pressed, if they press the "reset" one, it will unhide all the columns.

How do I do it? Do I need to do a "reset" macro for each existing macro - to show the hidden columns or can I have one "reset" button that will show all regardless of what macro has been used.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

pcc

Well-known Member
Joined
Jan 21, 2003
Messages
1,345
Code:
Cells.EntireColumn.Hidden = False

should do it
 

stuartford

Active Member
Joined
Nov 28, 2002
Messages
419
does the macro need to unhide only the last lot of hidden items or all hidden items?

if its the latter just record a macro that unhides all within the current sheet

hope this helps

Stuart

ie
Cells.Select
Selection.EntireColumn.Hidden = False
Selection.EntireRow.Hidden = False
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
This will unhide all columns:

ActiveSheet.Cells.EntireColumn.Hidden = False

Maybe you should change your existing macros so that they toggle the hidden property. Example:

Code:
Private Sub CommandButton1_Click()
    With Columns("C:D")
        .EntireColumn.Hidden = Not .EntireColumn.Hidden
        If .EntireColumn.Hidden = False Then
            CommandButton1.Caption = "Hide columns"
        Else
            CommandButton1.Caption = "Unhide columns"
        End If
    End With
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,133,463
Messages
5,658,912
Members
418,476
Latest member
Tristram_ZX81

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
Top