Scroll the window to the top - frozen rows

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
Sub test()
Dim i As Long, j As Long

i = ActiveWindow.SplitRow + 1
If i = 1 Then i = Selection.Row
j = ActiveWindow.SplitColumn + 1
If j = 1 Then j = Selection.Column
Cells(i, j).Select
End Sub
 
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
 
MDW
Try
[A2].Select
[A1].Select

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

HTH

Bob C
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top