Good afternoon,
I am tiring to rename a sheet tab based on a specific cell.
I have attempted to use this code:
Sub rename_Sheet()
Dim OldName As String
OldName = ActiveSheet.Name
On Error Resume Next
ActiveSheet.Name = Range("A1").Value
On Error GoTo 0
If OldName = ActiveSheet.Name Then
MsgBox "Worksheet not renamed, Illegal name or no data available"
End If
End Sub
but it does not work for me.
I am pretty sure I am doing something incorrectly.
I am wanting to rename my sheet tab based on Cell "DQ7" with is a date.
Any help would be greatly appreciated.
I am tiring to rename a sheet tab based on a specific cell.
I have attempted to use this code:
Sub rename_Sheet()
Dim OldName As String
OldName = ActiveSheet.Name
On Error Resume Next
ActiveSheet.Name = Range("A1").Value
On Error GoTo 0
If OldName = ActiveSheet.Name Then
MsgBox "Worksheet not renamed, Illegal name or no data available"
End If
End Sub
but it does not work for me.
I am pretty sure I am doing something incorrectly.
I am wanting to rename my sheet tab based on Cell "DQ7" with is a date.
Any help would be greatly appreciated.