• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

variable sheet names [SOLVED]

hoomantt

Member
hello

i have a question and it is necessary for me to solve it.

i have 18 workbooks that manage salary of 128 persons .

in every workbook , there is a sheet that in column(A) there is personal names.

in every work book there are variable sheets.for example in one workbook there is 30 sheets for 30 persons.in another there are 14 sheets and . . .

i make all sheets for persons and just want to name the sheet by cell A2 in these sheets.

for example : if there is name(ali) in cell A2 in sheet1 with a formula or macro the name of this sheet change to name in cell A2 (ali)

thanks from every professors.
 
Hi ,


Try this in the ThisWorkbook section of your workbook :

[pre]
Code:
Public Sub Rename_Sheets()
Dim wks As Worksheet
For Each wks In Worksheets
If InStr(1, wks.Name, "Sheet") > 0 Then
wks.Name = wks.[A2]
End If
Next
End Sub
[/pre]
Narayan
 
Back
Top