• 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.

rename Sheets with a cell name

hoomantt

Member
hi;

I Have a file that there is a column(column B)in a sheet with name :(A) include the name of some visitors that can changes every month . there are some sheets with visitors name .

how can write a program or a formula to change sheets name with the names in column B in Sheet (name:A) ?

at most there are 30 visitors and at mean there are 2 visitors for evry branch .

Thanks A lot , professionals.
 
Hi Hoomantt


I don't know if I have understood your problem correctly. But if you want to rename the sheet based on the cell value, you can use the following macro. Press Alt F11 and paste the following code as follows.


In the workbook,


Private Sub Workbook_Open()

Call NameSheet

End Sub


Insert a module and put the following code,


Function NameSheet()

For i = 1 To Worksheets.Count

Sheets(i).Select

Sheets(i).Name = Cells(1, 1).Value

Next i

End Function


This code will change the name of sheet to content of A1 whenever the sheet is opened.


Amritansh
 
Hi, hoomantt!

Even amrit1186's code works fine, I'm not sure if it's what you're looking for. If it isn't, would you please elaborate a bit more and upload a sample file? Thank you.

Regards!
 
Back
Top