+ Reply to Thread
Results 1 to 5 of 5

Opening file to certain worksheet

  1. #1
    Forum Contributor
    Join Date
    11-22-2003
    Location
    Newport, Rhode Island
    MS-Off Ver
    Excel 365
    Posts
    158

    Opening file to certain worksheet

    Hello All,

    Using Excel 2007.

    I have a workbook that has worksheets in a format of mmmdd (ex Jul04). Each of the tabs contain the end dates of bi-weekly reports. When I open the workbook I would like it to open to the worksheet that has the date that falls before the end date of the worksheet tabs.

    I have attached a picture file that shows some of the tabs (worksheets) on the bottom. When I open the file I would like it to go to the Aug01 worksheet and highlight it red. (Jul21 is before the Aug01 tab but after the Jul18 tab).

    Any help in making the code to do this would be appreciated.

    Mike
    Attached Images Attached Images

  2. #2
    Registered User
    Join Date
    05-07-2008
    Posts
    5
    If I am readng your question right, save the file on the worksheet you want it opened to. Next time you open it - it will open to that worksheet.

    Next week, save the file in the following week's worksheet and it will open up there.

  3. #3
    Forum Contributor
    Join Date
    11-22-2003
    Location
    Newport, Rhode Island
    MS-Off Ver
    Excel 365
    Posts
    158
    This worksheet I made up for someone at my work.

    Besides the 26 bi weekly tabs Ii also have 100 other worksheets with people names on them. Sometimes the worksheet would be saved going to one of these tabs, so the next time it is open it will find the right date and open up that workout plus color code the tab.

    I have some code that works with a certain date:

    Private Sub Workbook_Open()
    On Error Resume Next
    On Error GoTo 0
    Sheets(Format(Date - 1, "mmmdd")).Activate
    ActiveSheet.Tab.ColorIndex = 3
    On Error GoTo 0
    Range("A2").Select

    End Sub


    I need code like that but the date would be a 14 day period.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    windme,

    Please read the Forum Rules and then wrap your code with Code Tags.

  5. #5
    Forum Contributor
    Join Date
    11-22-2003
    Location
    Newport, Rhode Island
    MS-Off Ver
    Excel 365
    Posts
    158

    correction on code

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1