gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,338
- Office Version
- 365
- Platform
- Windows
How do I modify this so that is cell R2 has the word Template in it, the code does not change the tab name?
Thanks!
Code:
Private Sub Worksheet_Deactivate()
'Updateby20150602
Dim Ws As Worksheet
Dim rngAddr As String
Dim Name As String
rngAddr = "R1"
For Each Ws In Application.ActiveWorkbook.Sheets
Name = Ws.Range(rngAddr).Value
If Name <> "" Then
Ws.Name = Name
End If
Next
End Sub
Thanks!