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 ?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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:
    ActiveWindow.FreezePanes = True
-PolakAuthor Commented:
That will freeze Columns A:B and Row 1, but does nothing for Columns Z:Y....
Saqib Husain, SyedEngineerCommented:
You would have to select the appropriate cell with


and then do the freeze.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

-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.
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

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.
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.

Rob H
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.