Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Tom!
Tom Ogilvy wrote: Sub AllSheetsUnhideUnProtectWGrid() 'for all sheets in currently active workbook, assigned to button 'Password Dim WkSht As Worksheet Dim PWORD As String PWORD = "dave" Application.ScreenUpdating = False For Each WkSht In ActiveWorkbook.Worksheets If Not WkSht.Visible Then WkSht.Visible = True End If Wksht.Activate WkSht.Unprotect Password:=PWORD ActiveWindow.DisplayGridlines = True Next WkSht Application.ScreenUpdating = True End Sub -- Regards, Tom Ogilvy "davegb" wrote in message ups.com... Can anyone tell me why this macro turns on the gridline display on some worksheets, but not others, in the workbook? It's supposed to show all sheets, unprotect all sheets, and turn on gridlines on all sheets. Sub AllSheetsUnhideUnProtectWGrid() 'for all sheets in currently active workbook, assigned to button 'Password Dim WkSht As Worksheet Dim PWORD As String PWORD = "dave" Application.ScreenUpdating = False For Each WkSht In ActiveWorkbook.Worksheets If Not WkSht.Visible Then WkSht.Visible = True End If WkSht.Unprotect Password:=PWORD ActiveWindow.DisplayGridlines = True Next WkSht Application.ScreenUpdating = True End Sub As always, thanks in advance! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Why the Inconsistent Macro Security Notification? | Excel Discussion (Misc queries) | |||
Excel clip board inconsistent behavior | Excel Discussion (Misc queries) | |||
Inconsistent Macro Behavior | Excel Discussion (Misc queries) | |||
Opening an HTML doc - inconsistent results manual vs macro. | Excel Programming | |||
Inconsistent Behavior on Web vs. Local Disk | Excel Programming |