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 |
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 |
All times are GMT +1. The time now is 01:26 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com