|
-
Nov 22nd, 2004, 03:37 PM
#1
Thread Starter
Frenzied Member
EXCEL: Position sheet view in window ???
Esteemed Forum Participants and Lurkers:
==============================
**** Excel 97 ****
I am trying to position a worksheet in a window. I have five header rows and one column frozen (Menu Bar > Window > Freeze Panes) and I can search and find the current date in the left column. What I want to do is to make the row for the CURRENT DATE the FIRST ROW viewed under the frozen pane rows. I am doing this in an "Auto_Open" macro to open the workbook with the optimal view for the user. I want to immediately view as much data as possible starting from the selected date, and data from previous dates is worthless (to view - don't suggest deleting it!).
I can get close ... I select the bottom date cell in the sheet, and then walk up the sheet selecting cells until I get to the current date. This only guarantees that the selected cell is within the viewing area ... but I want it at the top of the moveable viewing pane just like I can accomplish by cliking the scroll bar 'up arrow" with the mouse.
Does anyone have any idea as to how to accomplish this?
Last edited by Webtest; Dec 1st, 2004 at 09:34 AM.
Blessings in abundance,
All the Best,
& ENJOY!
Art . . . . Carlisle, PA . . USA
-
Nov 23rd, 2004, 05:09 PM
#2
VB Code:
Dim intRowCounter As Integer
For intRowCounter = 1 To UsedRange.SpecialCells(xlCellTypeLastCell).Row
If CStr(Trim(Cells(intRowCounter, 1))) = CStr(Format(Now, "dd/mm/yyyy")) Then
Application.Goto Cells(intRowCounter, 1), True
End If
Next intRowCounter
The Goto command has a useful 2nd Scroll parameter/argument which, when set to true will do exactly what you're after!!!
-
Dec 1st, 2004, 09:12 AM
#3
Thread Starter
Frenzied Member
Alex_read:
Well, I survived the holidays and the crunch at work these past 2 days.
Thank you very much for your gracious assistance. The second parameter boolean for "Goto" was indeed exactly what I needed! It works perfectly.
I had actually tried a kludge fix ... after I found the correct row and selected it, I set the height to the maximum of 409, reselected the row, and then set the height back to the correct value (12.75). Your way of doing it is much better. Thanks again.
Blessings in abundance,
All the Best,
& ENJOY!
Art . . . . Carlisle, PA . . USA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|