Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Code to automatically reset the Freeze Panes settings
Maybe this will get you started:
Sub ABCDD() Dim rng As Range Set rng = ActiveSheet.PivotTables(1).DataBodyRange rng(1).Select ActiveWindow.FreezePanes = False ActiveWindow.FreezePanes = True End Sub -- regards, Tom Ogilvy "SaeOngJeeMa" wrote in message ... Hello, I have a spreadsheet with a bunch of controls on a Pivot Table Worksheet that use VBA code to control the Pivot Table layout. Every time the user clicks a control it changes the configuration of Pagefields, Rowfields, Datafields and Columnfields. I'd like to have a (hopefully simple) VBA Sub that changes the Freeze Panes settings relative to the newest position of the upper leftmost Datafield. The one thing I'm missing is a way to easily find that upper leftmost Datafield cell position using VBA code. Does anyone know a simple way of locating that cell? Thanks in advance. Best Regards, Dean |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Code to automatically reset the Freeze Panes settings
Hey Tom,
Worked great! Thanks. -- Best Regards, Dean "Tom Ogilvy" wrote: Maybe this will get you started: Sub ABCDD() Dim rng As Range Set rng = ActiveSheet.PivotTables(1).DataBodyRange rng(1).Select ActiveWindow.FreezePanes = False ActiveWindow.FreezePanes = True End Sub -- regards, Tom Ogilvy "SaeOngJeeMa" wrote in message ... Hello, I have a spreadsheet with a bunch of controls on a Pivot Table Worksheet that use VBA code to control the Pivot Table layout. Every time the user clicks a control it changes the configuration of Pagefields, Rowfields, Datafields and Columnfields. I'd like to have a (hopefully simple) VBA Sub that changes the Freeze Panes settings relative to the newest position of the upper leftmost Datafield. The one thing I'm missing is a way to easily find that upper leftmost Datafield cell position using VBA code. Does anyone know a simple way of locating that cell? Thanks in advance. Best Regards, Dean |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2003 freeze panes won't freeze top row only | Excel Discussion (Misc queries) | |||
Freeze panes automatically freezes at r14 when I highlight r1? | Excel Discussion (Misc queries) | |||
Freeze panes | Excel Discussion (Misc queries) | |||
freeze panes? | Excel Discussion (Misc queries) | |||
freeze panes? | New Users to Excel |