Hi everybody,
I have a strage problem. I am trying to cycle through all the sheets in the orkbook and hide header, sheet tabs and the gridlines. I have tried to do this through 2 macros
the second macro I tried was
Once the macro has been run, the active worksheet is appropriately "cleaned". But as I cycle through the worksheets with CTRL+PGDN/PGUP, the other worksheets have not been hidden appropriately. Interestingly, if I press CTRL+DN and go to the end of the worksheet, the sheet tabs then hide. But the grid is still visible. If I run the macro again, it again cleans the activesheet but not the remaining sheets.
Is something wrong with the macro??
I have a strage problem. I am trying to cycle through all the sheets in the orkbook and hide header, sheet tabs and the gridlines. I have tried to do this through 2 macros
Code:
Sub DeGridize()
Dim wd As Window
For Each wd In ThisWorkbook.Windows
With ActiveWindow
.DisplayHeadings = False
.DisplayGridlines = False
.DisplayWorkbookTabs = False
End With
Next wd
End Sub
the second macro I tried was
Code:
Sub DeGridize()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheet
With ActiveWindow
.DisplayHeadings = False
.DisplayGridlines = False
.DisplayWorkbookTabs = False
End With
Next ws
End Sub
Once the macro has been run, the active worksheet is appropriately "cleaned". But as I cycle through the worksheets with CTRL+PGDN/PGUP, the other worksheets have not been hidden appropriately. Interestingly, if I press CTRL+DN and go to the end of the worksheet, the sheet tabs then hide. But the grid is still visible. If I run the macro again, it again cleans the activesheet but not the remaining sheets.
Is something wrong with the macro??
Last edited: