Identifying the freeze panes position in a sheet using VBA

jt006

New Member
Joined
Aug 9, 2007
Messages
2
I am trying to design a macro which transfers the freeze panes setting from one worksheet to another.

To do this I would like to identify the position at which panes are frozen in the original sheet, then go to the destination sheet, activate the same cell and set freezepanes to true.

Unfortunately, as the freezepanes property in VBA is a boolean, I can't seem to find a way of identifying the position at which panes have been frozen in the original sheet. My friend swears he's done this before but can't remember how.

Can anybody out there help me?

Thanks

JT
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Welcome to the board :biggrin:

See if this helps:

Code:
Sub test()
Dim i As Integer
For i = 1 To ActiveWindow.Panes.Count
    MsgBox "Pane " & i & " " & ActiveWindow.Panes(i).VisibleRange.Address
Next i
End Sub
 
Upvote 0
Thanks!

Thanks for that, I'd thought about doing it in a similar way, but as I'm quite new to VBA I was stuggling to get the language right.

I haven't incorporated this into my model yet but i'll let you know how it goes when I do. :biggrin:
 
Upvote 0

Forum statistics

Threads
1,216,098
Messages
6,128,812
Members
449,468
Latest member
AGreen17

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