Can I use VBA to freeze detached horizontal and vertical panes?

For example, is it possible to force Excel to freeze-pane Columns A:B, Columns Z:Y: and Rows 1:2 ?
LVL 1
-PolakAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Saqib Husain, SyedEngineerCommented:
Cells(2,3).select
    ActiveWindow.FreezePanes = True
0
-PolakAuthor Commented:
That will freeze Columns A:B and Row 1, but does nothing for Columns Z:Y....
0
Saqib Husain, SyedEngineerCommented:
You would have to select the appropriate cell with

Cells(2,3).select

and then do the freeze.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

-PolakAuthor Commented:
If I try and put additional arguments into the cell select to freeze A:B & Y:Z and rows 1:2 I get a too many arguments error.

Again, I'm trying to freeze A:B, Y:Z, AND rows 1:2 simultaneously.....

It would be like Selecting cell C3 and AA3 and then freezing panes. Basically if a user were to scroll to the right past Y:Z both A:B and Y:Z would appear on the left side of the screen.
0
Saqib Husain, SyedEngineerCommented:
No, you cannot do that. You can select either the leftmost columns or the topmost rows or both. Any other selection does not apply to freezing
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
-PolakAuthor Commented:
Thank you, was hoping VBA could force creating a "window"-layer on top of the spreadsheet.
0
Rob HensonFinance AnalystCommented:
You could get round it with a manual tweak.

In the View tab select new Window and then Arrange All and choose Vertical and tick box for Windows of Active Workbook.

This will show the same sheet twice. Resize the left hand Window so that you can see only columns A & B and stretch the right hand window to fill the rest of the screen. Scroll the right hand window so that column Y is first column on sheet and then select AA3 and apply Freeze Panes.

In the View tab now select "View Side by Side" and "Synchronous Scrolling". The two windows will now scroll vertically in sync and to an extent horizontally; scrolling right on the Right hand pane won't scroll the left hand pane until after several scrolls.

Thanks
Rob H
1
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.