VBA: Freeze Panes
I recently posted on Freezing panes in Excel, here’s how you can do it using VBA:
Freeze Rows
Rows("1:1").Select
ActiveWindow.FreezePanes = True
Freeze Columns
Range("A:A").Select
ActiveWindow.FreezePanes = True
Freeze Rows and Columns
Range("B2").Select
ActiveWindow.FreezePanes = True
UnFreeze Panes
ActiveWindow.FreezePanes = False


On a worksheet where panes are frozen, and the workbook is scrolled to the right, how do you use VBA to scroll the columns right of the freeze back to their original position, so that all columns are visible from left to right?
Steve,
The VBA to scroll around is here: VBA: Scroll Vertically and Scroll Horizontally
I’m guessing that should work for you.
Maybe:
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
How do you remove the darker spreadsheet lines that show where the frozen panes begin/end? I’d like to do that via vba if possible.
Matt
Not sure off the top of my head, may have to hit the newsgroups.