LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 334
Default scroll rows up or down

I am using this code to find the current cell that matches the current date.
All works fine except I want to also have the current cell go to the top of
the window under the frozen headings. How can I alter the code to do this.

Dim SubStr
Dim MyCell As Range
Dim NextRow As Range
Sheets("Food").Select
Cells.Select
Selection.Columns.AutoFit
Range("A2:E2").Select
SubStr = Date
Call NxtRow(SubStr, MyCell, NextRow)
NextRow.Select
End Sub
Sub NxtRow(SubStr, MyCell, NextRow)
'
Cells.Select
Set MyCell = ActiveSheet.Range("A4")
Do
If MyCell.Value = "" Then
Exit Do
ElseIf MyCell.Value = SubStr Then
Set NextRow = MyCell
Exit Do
Else
Set MyCell = MyCell.Offset(1, 0)
End If
Loop
End Sub
--
Rick Rack
 
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
rows 4-15 will not scroll Jackie Taylor Excel Worksheet Functions 1 June 20th 07 11:01 PM
I can not move or scroll to the top rows (7 to 1) sax30 Excel Discussion (Misc queries) 3 September 11th 05 01:47 PM
Highlight entire rows as I scroll? blackrb1 Excel Discussion (Misc queries) 2 May 20th 05 04:13 PM
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 03:39 PM.

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

About Us

"It's about Microsoft Excel"