Villalobos
Active Member
Hello,
Now I use the below mentioned code to hide the row and colum headers, but I can not protect it. I mean that how should modify the code to avoid that if somebody want to see the heading just click Tools | Options, View. Check "Rows and columns headers" ? How do I turn off via VBA this option?
Private Sub hideHeadings()
Dim wrkbk As Workbook
Dim wrksh As Worksheet
Dim prev As Window
Set prev = ActiveWindow
For Each wrkbk In Workbooks
For Each wrksh In wrkbk.Worksheets
wrksh.Activate
ActiveWindow.DisplayHeadings = False
Next wrksh
Next wrkbk
prev.Activate
End Sub
Thanks in advance the reply!
Now I use the below mentioned code to hide the row and colum headers, but I can not protect it. I mean that how should modify the code to avoid that if somebody want to see the heading just click Tools | Options, View. Check "Rows and columns headers" ? How do I turn off via VBA this option?
Private Sub hideHeadings()
Dim wrkbk As Workbook
Dim wrksh As Worksheet
Dim prev As Window
Set prev = ActiveWindow
For Each wrkbk In Workbooks
For Each wrksh In wrkbk.Worksheets
wrksh.Activate
ActiveWindow.DisplayHeadings = False
Next wrksh
Next wrkbk
prev.Activate
End Sub
Thanks in advance the reply!