Results 1 to 7 of 7

Thread: Rename tab on cell value from another worksheet

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Oct 2014
    Posts
    26
    Rep Power
    0

    Rename tab on cell value from another worksheet

    Hi All,

    I need a help to make my code work. I'm trying to rename worksheet one at a time but i'm having problem in using cell reference. see my code below and thanks in advanced for your help


    Code:
    Sub rename()
    
    Application.ScreenUpdating = False
    On Error GoTo error_handler
    
    
    If Range("C2") = "sports" Then
        Sheets(Format(Range("B2").Value)).Select
    '    ActiveSheet.Name = need to get the active sheet's new name from Xref sheet D2
        On Error GoTo error_handler
        
    Exit Sub
       
    
    End If
    
    error_handler:
    
        Sheets("Main").Select
        MsgBox ("Sheet name already exist")
    
    Application.ScreenUpdating = True
    
    End Sub
    Attached Files Attached Files
    Last edited by jeremiah_j2k; 12-02-2014 at 09:41 AM.

Similar Threads

  1. Change Tab Color base on value of cell % Change
    By mrprofit in forum Excel Help
    Replies: 8
    Last Post: 04-16-2014, 10:38 AM
  2. Worksheet Tab Name Based on Cell Value
    By tuna666 in forum Excel Help
    Replies: 2
    Last Post: 10-08-2013, 10:41 PM
  3. Need help to add sheet, rename and update in TOC
    By kets0985 in forum Excel Help
    Replies: 2
    Last Post: 07-28-2013, 06:04 PM
  4. Copy Template Worksheet And Rename With Custom Name
    By peter renton in forum Excel Help
    Replies: 5
    Last Post: 06-07-2013, 03:50 PM
  5. Rename Filename Through VBA
    By Excel Fox in forum Excel and VBA Tips and Tricks
    Replies: 0
    Last Post: 08-30-2011, 08:29 PM

Posting Permissions

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