PDA

View Full Version : row and column headers



ProteanBeing
02-02-2008, 06:04 PM
I have created a hidden button that hides / shows (toggles) the menu and toolbars so that I can edit the file when I need to. I would like to toggle the row and column headers to but I can't seem to make it work. This is what I was trying to do:

dim MyTabs as worksheets

for each MyTabs in workbook
MyTabs.DisplayHeadings = false
next MyTabs

I get an Object Required error.

What am I doing wrong?

qff
02-03-2008, 12:48 AM
Hi
I think this only works for the active window.

Try something like this to toggle the headings on/off

Sub myHeaders()
Dim mySheet As Worksheet
Dim myStart As Worksheet

Set myStart = ActiveSheet

Application.ScreenUpdating = False

For Each mySheet In Worksheets
mySheet.Activate
ActiveWindow.DisplayHeadings = Not ActiveWindow.DisplayHeadings
Next

myStart.Activate

Application.ScreenUpdating = True
End Sub