LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default Inconsistent macro behavior

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why the Inconsistent Macro Security Notification? Oakwood Excel Discussion (Misc queries) 0 May 18th 09 06:44 PM
Excel clip board inconsistent behavior Bas V Excel Discussion (Misc queries) 0 January 30th 08 09:28 PM
Inconsistent Macro Behavior Sarah K Excel Discussion (Misc queries) 4 November 1st 05 10:36 PM
Opening an HTML doc - inconsistent results manual vs macro. KeithB Excel Programming 1 August 18th 04 06:38 PM
Inconsistent Behavior on Web vs. Local Disk D. A. Gray Excel Programming 0 July 27th 03 08:13 PM


All times are GMT +1. The time now is 11:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"