Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    Tokyo, Japan
    Posts
    203
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Selecting a cell at startup (Excel 2002)

    I have a series of date in a row say from Sept to June the following year. Upon loading the spreadsheet I would like the cell pointer to go to the cell below the cell with the current date. Is this possible? TIA

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Selecting a cell at startup (Excel 2002)

    Something like this in the thisWorkbook object whould work.

    It assumes the dates are in row 1 and are ascending. change as appropriate

    Steve

    <pre>Private Sub Workbook_Open()
    Dim rCell As Range
    Dim rng As Range
    Set rng = Range("1:1")

    For Each rCell In rng
    If rCell.Value > Now Then
    rCell.Offset(1, -1).Select
    Exit Sub
    End If
    Next
    End Sub</pre>


  3. #3
    3 Star Lounger
    Join Date
    Feb 2001
    Location
    Tokyo, Japan
    Posts
    203
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Selecting a cell at startup (Excel 2002)

    Works like a charm. Thank you Steve.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •