Mazbuka
New Member
- Joined
- Sep 23, 2018
- Messages
- 23
- Office Version
- 365
- Platform
- Windows
Hope I can explain this alright.
I posted the below code to name the sheet tab as per contents of cell C2
Now in another sheet if I want to refer to the named sheet using =INDIRECT(A2&"!M28") where A2 has the name of the tab, it returns an error...however if I change A2 & the tab name to say xxxx it works.
Is this a known issue?
Sub RenameSheet()
Dim rs As Worksheet
For Each rs In Sheets
rs.Name = rs.Range("c2")
Next rs
End Sub
I posted the below code to name the sheet tab as per contents of cell C2
Now in another sheet if I want to refer to the named sheet using =INDIRECT(A2&"!M28") where A2 has the name of the tab, it returns an error...however if I change A2 & the tab name to say xxxx it works.
Is this a known issue?
Sub RenameSheet()
Dim rs As Worksheet
For Each rs In Sheets
rs.Name = rs.Range("c2")
Next rs
End Sub