ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   panes frozen, set visible part of screen (https://www.excelbanter.com/excel-programming/352417-panes-frozen-set-visible-part-screen.html)

[email protected]

panes frozen, set visible part of screen
 
A navigation/scrolling/display question...

In a worksheet, I used Window | Freeze Panes at cell B6 to freeze the
headings (the first 5 rows and 1 column). Normally, column B would be
displayed after column A. If you scroll to the right a ways, thre
won't be room for column B, so column C will appears next to column A.
If you keep scrolling, column D will be after column A. And so on.
How can I tell Excel which column I want to be displayed next to column
A (using VBA)?

I thought I could just select a cell WAY to the right, then select a
cell in the column I wanted to be displayed right after column A, but
this doesn't work. For example, if I select cell Z6, then cell F6,
column B (not F) is displayed right after column A.

(For background, I'm testing my code using breakpoints, and the VBE
always obscures part of the worksheet, sometimes the part that is being
worked on, and so I keep having to Alt-Tab, scroll, then Alt-Tab back,
which after a while is starting to become a waste of time.)


Tom Ogilvy

panes frozen, set visible part of screen
 
ActiveWindow.Scollcolumn = 4

--
Regards,
Tom Ogilvy


wrote in message
oups.com...
A navigation/scrolling/display question...

In a worksheet, I used Window | Freeze Panes at cell B6 to freeze the
headings (the first 5 rows and 1 column). Normally, column B would be
displayed after column A. If you scroll to the right a ways, thre
won't be room for column B, so column C will appears next to column A.
If you keep scrolling, column D will be after column A. And so on.
How can I tell Excel which column I want to be displayed next to column
A (using VBA)?

I thought I could just select a cell WAY to the right, then select a
cell in the column I wanted to be displayed right after column A, but
this doesn't work. For example, if I select cell Z6, then cell F6,
column B (not F) is displayed right after column A.

(For background, I'm testing my code using breakpoints, and the VBE
always obscures part of the worksheet, sometimes the part that is being
worked on, and so I keep having to Alt-Tab, scroll, then Alt-Tab back,
which after a while is starting to become a waste of time.)




[email protected]

panes frozen, set visible part of screen
 
Ah, so simple. It must be great to be a guru. Thanks.



All times are GMT +1. The time now is 09:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com