Hide Row and Column Headings

  • Thread starter Thread starter Sandy
  • Start date Start date
S

Sandy

The following hides the Row and Column Headings for the activesheet. How can
it be adjusted to apply to the whole workbook

Sub HideRowAndColHeadings()
Windows("TestBook.xls").DisplayHeadings = False
End Sub

Thanks Sandy
 
Sub HideRowAndColHeadings()
Dim sh as Worksheet, sh1 as Worksheet
Application.ScreenUpdating = False
set sh1 = Activesheet
for each sh in Workbooks("TestBook.xls").Worksheets
sh.Activate
Windows("TestBook.xls").DisplayHeadings = False
Next
Application.ScreenUpdating = True
sh1.Activate
End Sub
 
try:
put this code under thisworkbook
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Windows("book1.xlsx").DisplayHeadings = False
End Sub
 
Hi
In the ThisWorkBook code module put this

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Application.Screenupdating = False
HideRowAndColHeadings
End Sub

bit oblique, but it does the job eventually!
Paul
 

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

Back
Top