+ Reply to Thread
Results 1 to 3 of 3

Macro that will name a tab from a specific cell

  1. #1
    Registered User
    Join Date
    09-18-2012
    Location
    Illinois
    MS-Off Ver
    Microsoft 360
    Posts
    58

    Macro that will name a tab from a specific cell

    Good Morning Experts,

    I received a macro that I thought would take the data from a specific cell (B7 in this case) and transfer that same data as the tab name on the active worksheet. I go to find that the macro will only run if every sheet in the worksheet contains data in cell B7, then every tab name will change. For my projects, I only need this to work on the active worksheet only. I do not have data in B7 on every worksheet and I definitely do not want to change the name on every tab. Below is the macro, but I do not know how to modify it so it only works on the active worksheet. Any help would be appreciated. Thanks much!

    Joe

    Sub ChangeSheetNames()
    Application.ScreenUpdating = False
    Dim ws As Worksheet
    For Each ws In Sheets
    If Not Evaluate("isref('" & ws.Range("B7") & "'!A1)") Then
    ws.Name = ws.Range("B7")
    End If
    Next ws
    Application.ScreenUpdating = True
    End Sub

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,215

    Re: Macro that will name a tab from a specific cell

    Try

    Please Login or Register  to view this content.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    09-18-2012
    Location
    Illinois
    MS-Off Ver
    Microsoft 360
    Posts
    58

    Re: Macro that will name a tab from a specific cell

    Quote Originally Posted by JohnTopley View Post
    Try

    Please Login or Register  to view this content.
    Thanks for a quick response that works great!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA MAcro to clear contents of specific cells if a specific cell contains text
    By muzzareilly in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2017, 12:47 PM
  2. VBA Macro: Copy and Paste Specific Row Range based on the Specific Value in a Cell.
    By SolidSmoke in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 10-10-2016, 02:40 PM
  3. Replies: 1
    Last Post: 08-13-2014, 05:46 PM
  4. [SOLVED] running a macro when specific text is entered into a specific cell
    By deek in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-02-2014, 10:05 AM
  5. Replies: 0
    Last Post: 07-11-2013, 02:08 AM
  6. Replies: 1
    Last Post: 06-30-2013, 05:58 PM
  7. Macro to copy specific line from text file and paste into specific cell in excel
    By keeneye in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-05-2013, 10:35 AM

Tags for this Thread

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