View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
John John is offline
external usenet poster
 
Posts: 2,069
Default unhide, Remove filter, Unfreeze help

try updated version:

Sub clearsettings()
Application.ScreenUpdating = False
For Each sh In ActiveWorkbook.Sheets
With sh
.Activate
.Unprotect Password:="mypassword" '<< change as required
.Visible = True
If .FilterMode = True Then .ShowAllData
End With
With ActiveWindow
.FreezePanes = False
.Split = False
End With
Next sh
Application.ScreenUpdating = True
End Sub

I have added a line to unprotect sheet delete if not needed otherwise add
correct password.
--
jb


"Yossy" wrote:

Thanks John,
It does remove the freeze and splits if any but does not work for the filter
and hidden rows.


"john" wrote:

try following (not tested)

Sub clearsettings()
Application.ScreenUpdating = False
For Each sh In ActiveWorkbook.Sheets
With sh
.Activate
.Visible = True
If .FilterMode = True Then FilterMode = False
End With
With ActiveWindow
.FreezePanes = False
.Split = False
End With
Next sh
Application.ScreenUpdating = True
End Sub
--
jb


"Yossy" wrote:

I usually get a lot of files to work with and most of the time there can be
hidden sheets, freezed panes, split and filtered values.

Is there a way to run a macro and make sure that all my sheets in the folder
have been cleared of these functions before I can proceed.
will appreciate all help. Thanks