codedreamer
New Member
Hello,
I have a workbook with 20 tabs that need to be rename according to the contents of cell a1. The problem I face is that cell a1 gets its information from another worksheet. I know I can use the indirect function, but I really do not know how.
Sub RenameTab()
For Each ws In ThisWorkbook.Worksheets
ws.Name = ws.indirect.Value(a1)
Next
End Sub
Thanks for your help,
Codedreamer
I have a workbook with 20 tabs that need to be rename according to the contents of cell a1. The problem I face is that cell a1 gets its information from another worksheet. I know I can use the indirect function, but I really do not know how.
Sub RenameTab()
For Each ws In ThisWorkbook.Worksheets
ws.Name = ws.indirect.Value(a1)
Next
End Sub
Thanks for your help,
Codedreamer