ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Scroll the window to the top - frozen rows (https://www.excelbanter.com/excel-programming/313701-scroll-window-top-frozen-rows.html)

MDW

Scroll the window to the top - frozen rows
 
Hey all,

I've got some code that marches down a bunch of cells (about 700 rows) and
applies formatting and formulas. When it's done, I want it to jump back up to
the top. I was able to simply say

ActiveWorksheet.Range("A1").Select

to do what I wanted.

However, I froze the first row because it contains column headers. Now I
can't get the window to go back to the top. I've tried

ActiveWindow.ScrollRow = 1
and
ActiveWindow.ScrollRow = 2 (Only the first row is frozen).

Neither of them work. Any ideas?
--
Hmm...they have the Internet on COMPUTERS now!

Ivan F Moala[_28_]

Scroll the window to the top - frozen rows
 

you could try

Application.Goto [A4], True

where A4 is the cell below your frozen row pane.

Look up the [Goto Method] in your VBA Help files for more info

--
Ivan F Moal

-----------------------------------------------------------------------
Ivan F Moala's Profile: http://www.excelforum.com/member.php...nfo&userid=195
View this thread: http://www.excelforum.com/showthread.php?threadid=26968


Robert Christie[_3_]

Scroll the window to the top - frozen rows
 
MDW
Try
[A2].Select
[A1].Select

The A2 returns you to below your frozen row
The A1 becomes ActiveCell.

HTH

Bob C

"MDW" wrote:

Hey all,

I've got some code that marches down a bunch of cells (about 700 rows) and
applies formatting and formulas. When it's done, I want it to jump back up to
the top. I was able to simply say

ActiveWorksheet.Range("A1").Select

to do what I wanted.

However, I froze the first row because it contains column headers. Now I
can't get the window to go back to the top. I've tried

ActiveWindow.ScrollRow = 1
and
ActiveWindow.ScrollRow = 2 (Only the first row is frozen).

Neither of them work. Any ideas?
--
Hmm...they have the Internet on COMPUTERS now!



All times are GMT +1. The time now is 10:24 AM.

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