Copy Cell text to Tab(sheet) Name

bradjedis
4StarLounger
Posts: 440
Joined: 30 Mar 2010, 18:49
Location: United States

Copy Cell text to Tab(sheet) Name

Post by bradjedis »

Greetings,

I have searched, but cannot seem to find exactly what I am needing.

Situation: I am copying sheets from Many files into One Workbook. After doing so, I would like to run a macro to grab the data in Q6 and rename the Sheet, I would like this to cycle thru Each Sheet in the workbook.


Regards,
Brad

User avatar
HansV
Administrator
Posts: 72003
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Copy Cell text to Tab(sheet) Name

Post by HansV »

Run the following macro:

Code: Select all

Sub RenameSheets()
    Dim wsh As Worksheet
    On Error Resume Next
    For Each wsh In Worksheets
        wsh.Name = wsh.Range("Q6").Value
    Next wsh
End Sub
Regards,
Hans

bradjedis
4StarLounger
Posts: 440
Joined: 30 Mar 2010, 18:49
Location: United States

Re: Copy Cell text to Tab(sheet) Name

Post by bradjedis »

THanks! that worked great