VBA: Is there a way to tell what cell is the "frozen cell" where Freeze Panes was issued?

TomCon

Active Member
Joined
Mar 31, 2011
Messages
373
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
Is there a way to find out what cell the Freeze Panes command was issued on? That is, what is the upper left cell of the bottom right quadrant in a window view with frozen panes?

What i really want to do is select that cell in a macro, that is, mimic what the Excel UI does when you do Ctl-Home in a window with frozen panes.

If you record a macro Excel does not do anything special to record Ctl-Home, it just records something like "Range("B2").Select", which of course is not usable in the general case, unless you could query what cell was selected when Freeze Panes was issued.

Thanks!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Give this a try...
VBA Code:
  With ActiveWindow.Panes(1).VisibleRange
    Cells(.Rows.Count + 1, .Columns.Count + 1).Select
  End With
 
Upvote 0
Solution

Forum statistics

Threads
1,215,059
Messages
6,122,917
Members
449,093
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top