Keep options permanent fora given workbook

J

Jean-Luc

Hi,

I have unchecked "gridlines" and "zero values" (tools / options / view) .

But if I open a second window, these options are reset to default value.
Same problem if I make a copy of a worksheet

Please can you tell me how I could make these options permanent, for a given
workbook.

Thank you and kind regards.
 
G

Gary''s Student

Don't use:

Insert > Worksheet

Once you have set up the existing sheets, keep a spare, formatted, sheet.
If you need a new sheet, just make a copy of the spare.
 
J

Jean-Luc

Hi, Gary"s Student
Thank you for prompt reply ... but sorry :
1. my very first question is about "opening a second window" . Using a kind
of template will not help.
2. below the question, I mentioned "Same problem if I make a copy of a
worksheet"
Please can somebody help ????
Kind regards,
Jean-Luc
 
B

Billy Liddel

Hi Jean-Luc

Post this into The Workbook code Module (Right-click Excel icon left of File
Menu & choose View code)

Private Sub Workbook_NewSheet(ByVal Sh As Object)

With ActiveWindow
.DisplayGridlines = False
.DisplayZeros = False
End With

End Sub


Regards
Peter Atherton
 
J

Jean-Luc

Billy,

Thank you for this useful tip .... but does not work when creating a new
WINDOW (not talking about a new worksheet).
Awfully sorry

Would somebody have a solution ?

thank you and kind regards,

Jean-Luc
 
B

Billy Liddel

Jean-Luc

Are you sure this is what you want? Every sheet in every open workbook to to
have no gridlines or zeros.

I would copy the following macros into your Personal Workbook. Then you can
run it whenever you want.

Sub AllWorkbooks()
Dim Wkb As Workbook
Dim wkbCount As Integer

For Each Wkb In Workbooks
Grids
Next Wkb

End Sub


Sub Grids()
Dim sht As Integer
Dim shtCount As Integer
Dim sShtName As String
Application.ScreenUpdating = False
shtCount = ActiveWorkbook.Sheets.Count
sShtName = ActiveSheet.Name

For sht = 1 To shtCount
Worksheets(sht).Activate
With activewindow
.DisplayGridlines = False
.DisplayZeros = False
End With
Next sht

' Return to the activesheet
Sheets(sShtName).Activate
Application.ScreenUpdating = True

End Sub


You could assign a shortcut key for AllWorkbooks macro.

Hope this suits.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top