+ Reply to Thread
Results 1 to 2 of 2

Naming Worksheets

  1. #1
    Registered User
    Join Date
    12-08-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Naming Worksheets

    Hi

    I have a spreadsheet with 8 worksheets and would like to automatically name the last 7 worksheets Sheet3,4,5,6,7,8 and 9) from cells located on the first worksheet(Chart) which have been highlighted (see image).

    I have been able to find reference to naming worksheets from cells on the same sheet but not from cells on another sheet.
    spreadsheet.jpg

    I am using the following macro (B18 is the first cell range):

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim strNew As String, strOld As String
    If Target.Cells.Count > 1 Then Exit Sub

    With Sheets(1).Range("B18")
    On Error Resume Next
    If Not (Application.Intersect(Target, .DirectPrecedents) Is Nothing) Then
    strOld = Me.Name
    strNew = CStr(.Value)
    Me.Name = strNew



    End If
    On Error GoTo 0
    End With

    End Sub

    but cannot get it to work.

    Any assistance or advice would be appreciated

    cheers

    Warwick

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,885

    Re: Naming Worksheets

    Here's a link from earlier today

    http://www.excelforum.com/excel-prog...-workbook.html
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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