Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Display active cell in left center of screen

Posted on 2010-11-29
2
Medium Priority
?
474 Views
Last Modified: 2012-05-10
On open in "thisworkbook", put cursor on one cell below last cell with data and make that cursor appear on left center of screen.  Thanks for your help!
0
Comment
Question by:1r3o2n8
2 Comments
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 2000 total points
ID: 34230234
Something like this:

Private Sub Workbook_Open()
    Dim rngVis As Range
    Dim lngRow As Long, lngCol As Long
    Dim win As Window
    
    ' assumes column A for data check
    lngCol = 1
    Set win = ThisWorkbook.Windows(1)
    With ThisWorkbook.ActiveSheet
        Set rngVis = win.VisibleRange
        Debug.Print rngVis.Address
        ' get last row with data in col A
        lngRow = .Cells(.Rows.Count, lngCol).End(xlUp).Row + 1
        .Cells(lngRow, lngCol).Select
    End With
    With win
        .ScrollColumn = lngCol
        .ScrollRow = Application.Max(lngRow - (rngVis.Rows.Count / 2), 1)
    End With
        
End Sub

Open in new window

0
 

Author Closing Comment

by:1r3o2n8
ID: 34232102
It executed perfectly the first time.  Thanks so much !
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question