+ Reply to Thread
Results 1 to 5 of 5

Naming a worksheet based on cell data

  1. #1
    Registered User
    Join Date
    03-15-2005
    Posts
    3

    Naming a worksheet based on cell data

    Hello I'm wondering if this can be done and if so, I'm looking for a little help.

    I have a workbook with 5 worksheets included. Each worksheet has a 7 day calendar Starting with sunday; Sunday's value is in B4.

    I want to place a date value in cell B4 of sheet1 and have that value be the name of sheet1 and add one week for every following worksheet . For example, in sheet1 I input 1/1/2005; I would like Sheet1 to be named "Week of 1/1/2005", Sheet2 to be named "Week of 1/8/2005" Sheet3 to be named "Week of 1/15/2005" and so on. Any help or suggestions would be greatly appreciated.

    Thanks,
    Chris

    e-mail [email protected]

  2. #2
    Registered User
    Join Date
    03-09-2005
    Location
    Quebec, Canada
    Posts
    19
    Hi

    You cant use the caracter "/" in the name of your sheet.
    You have tu use a diffrent caracter

  3. #3
    Registered User
    Join Date
    03-15-2005
    Posts
    3
    "-" can be used instead of "/"

    Still need to solve the main problem though.

    Thanks,
    -Chris

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hi,

    Add the following code to each worksheets Worksheet Change Event procedure.

    Private Sub Worksheet_Change(ByVal Target As Excel.Range)

    If Target.AddressLocal(False, False) = "B2" Then
    ActiveSheet.Name = "Week of " & Format(Target.Value, "dd-mmm-yy")
    End If

    End Sub


    Hope this helps,
    Leith Ross

  5. #5
    Registered User
    Join Date
    03-15-2005
    Posts
    3
    Much thanks. It works great!

    -Chris

+ 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