Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deselect cells on multiple sheets after unhide
I have the following code I use to remove the autofilters and hidden rows and
columns within a workbook. It works great. My problem is that after it runs, the columns that were unhidden remain selected. I have more code later in the process that won't run because there are cells selected. Is there an easy snippet of code so that I can select cell "A2" on every sheet in a workbook at once? I've tried a couple on my own but no luck. Thanks! -- Thanks, Sherry |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deselect cells on multiple sheets after unhide
Oops...forgot the code. Sorry.
Sub RemoveFiltersAndHiddenRows() Dim oWS As Worksheet For Each oWS In ActiveWorkbook.Sheets oWS.AutoFilterMode = False oWS.UsedRange.Rows.Hidden = False oWS.UsedRange.Columns.Hidden = False Next End Sub -- Thanks, Sherry "Sherry" wrote: I have the following code I use to remove the autofilters and hidden rows and columns within a workbook. It works great. My problem is that after it runs, the columns that were unhidden remain selected. I have more code later in the process that won't run because there are cells selected. Is there an easy snippet of code so that I can select cell "A2" on every sheet in a workbook at once? I've tried a couple on my own but no luck. Thanks! -- Thanks, Sherry |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deselect cells on multiple sheets after unhide
Sherry,
see if this does what you want. Be mindful though that your code will error if any of the sheets are protected. Sub RemoveFiltersAndHiddenRows() Dim oWS As Worksheet With Application .EnableEvents = False .ScreenUpdating = False End With For Each oWS In ActiveWorkbook.Sheets With oWS .Activate .AutoFilterMode = False With .UsedRange .Rows.Hidden = False .Columns.Hidden = False End With .Range("A2").Select End With Next With Application .EnableEvents = True .ScreenUpdating = True End With End Sub -- jb "Sherry" wrote: Oops...forgot the code. Sorry. Sub RemoveFiltersAndHiddenRows() Dim oWS As Worksheet For Each oWS In ActiveWorkbook.Sheets oWS.AutoFilterMode = False oWS.UsedRange.Rows.Hidden = False oWS.UsedRange.Columns.Hidden = False Next End Sub -- Thanks, Sherry "Sherry" wrote: I have the following code I use to remove the autofilters and hidden rows and columns within a workbook. It works great. My problem is that after it runs, the columns that were unhidden remain selected. I have more code later in the process that won't run because there are cells selected. Is there an easy snippet of code so that I can select cell "A2" on every sheet in a workbook at once? I've tried a couple on my own but no luck. Thanks! -- Thanks, Sherry |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deselect cells on multiple sheets after unhide
Works great! Thanks, John!
-- Thanks, Sherry "john" wrote: Sherry, see if this does what you want. Be mindful though that your code will error if any of the sheets are protected. Sub RemoveFiltersAndHiddenRows() Dim oWS As Worksheet With Application .EnableEvents = False .ScreenUpdating = False End With For Each oWS In ActiveWorkbook.Sheets With oWS .Activate .AutoFilterMode = False With .UsedRange .Rows.Hidden = False .Columns.Hidden = False End With .Range("A2").Select End With Next With Application .EnableEvents = True .ScreenUpdating = True End With End Sub -- jb "Sherry" wrote: Oops...forgot the code. Sorry. Sub RemoveFiltersAndHiddenRows() Dim oWS As Worksheet For Each oWS In ActiveWorkbook.Sheets oWS.AutoFilterMode = False oWS.UsedRange.Rows.Hidden = False oWS.UsedRange.Columns.Hidden = False Next End Sub -- Thanks, Sherry "Sherry" wrote: I have the following code I use to remove the autofilters and hidden rows and columns within a workbook. It works great. My problem is that after it runs, the columns that were unhidden remain selected. I have more code later in the process that won't run because there are cells selected. Is there an easy snippet of code so that I can select cell "A2" on every sheet in a workbook at once? I've tried a couple on my own but no luck. Thanks! -- Thanks, Sherry |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unhide multiple sheets | Excel Discussion (Misc queries) | |||
Unhide multiple sheets all at once | Excel Discussion (Misc queries) | |||
How to unhide multiple sheets in one go | Excel Programming | |||
Can I unhide multiple sheets at once? | Excel Discussion (Misc queries) | |||
How do I unhide multiple sheets? | Excel Worksheet Functions |