"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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

pcc

Well-known Member
Joined
Jan 21, 2003
Messages
1,348
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
 

Forum statistics

Threads
1,172,219
Messages
5,879,746
Members
433,454
Latest member
xWiZardx

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