I populate an Excel file with the data from my data base, and often I would like to Freeze Panes so the header will be always visible, even if user scrolls up or down.
What I do is:
That works fine if Sheet(1) is an Active sheet.
But if I place data in Sheet(5) without 'activating' that worksheet, I get an error: 'Object doesn't support this property or method.' Makes sense.
But that happens even if I do Activate this sheet:
So, what would be the way to FreezePanes on Sheets(5)?
---- Andy
"Hmm...they have the internet on computers now"--Homer Simpson
What I do is:
Code:
With Sheets(1)
.Range("A2").Select
.ActiveWindow.FreezePanes = True
End With
That works fine if Sheet(1) is an Active sheet.
But if I place data in Sheet(5) without 'activating' that worksheet, I get an error: 'Object doesn't support this property or method.' Makes sense.
But that happens even if I do Activate this sheet:
Code:
With Sheets(5)[red]
.Activate[/red]
.Range("A2").Select
.ActiveWindow.FreezePanes = True
End With
So, what would be the way to FreezePanes on Sheets(5)?
---- Andy
"Hmm...they have the internet on computers now"--Homer Simpson