Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Scroll the window to the top - frozen rows

After fooling around with this routine, I've discovered it wont always
select the correct cell.
If a frozen pane (say, the column heading) is row 4 instead of row 1 then
strange things happen.

This routine should do the trick:

Sub test()
With ActiveWindow.Panes(ActiveWindow.Panes.Count)
.SmallScroll Up:=Rows.Count, ToLeft:=Columns.Count
.VisibleRange(1).Select
End With
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Rob van Gelder" wrote in message
news:...
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


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"MDW" wrote in message
...
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!





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
headers frozen so that when you scroll they stay miguel Excel Discussion (Misc queries) 1 May 17th 10 08:58 PM
Scroll bar disappears when panes frozen AIS Jay Excel Discussion (Misc queries) 0 March 30th 10 04:55 PM
Frozen rows Old_skills_lost[_2_] New Users to Excel 5 January 19th 08 12:59 AM
The top six rows are "frozen" and do not move when I scroll down.. Bud Excel Worksheet Functions 2 December 29th 04 10:00 PM
Scroll the window to the top - frozen rows MDW Excel Programming 2 October 16th 04 06:31 PM


All times are GMT +1. The time now is 01:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"