Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    199
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Position Active Cell on Opening (Excel2K)

    Hi,

    I have several worksheets which contain a vertical list of dates (defined as "Dates") in ascending sequence on the left.

    Could some generous soul provide some code to incorporate into "Open_Workbook" so that when one of these workbooks is opened, the Active Cell will be on this sheet and the cell to the right of the current day's date, positioned for the entry of data.

    Thanks in anticipation.

    Peter Moran
    Two heads are always better than one!!

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Position Active Cell on Opening (Excel2K)

    The code below assumes that the worksheet you want to activate is named "Sheet1" (you didn't say what its name is). If that is not correct, you will need to modify this code accordingly:

    <pre>Private Sub Workbook_Open()
    Dim I As Long
    I = 0
    Worksheets("Sheet1").Activate
    For I = 0 To 65535
    If Int(ActiveSheet.Range("A1").Offset(I, 0)) = Date Then Exit For
    Next I
    If I <= 65535 Then
    Worksheets("Sheet1").Range("A1").Offset(I, 1).Select
    End If
    End Sub
    </pre>

    Legare Coleman

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    199
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Re: Position Active Cell on Opening (Excel2K)

    Hi Legare,

    Many thanks, will give it a try !

    Regards,

    Peter Moran
    Two heads are always better than one!!

Posting Permissions

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