I do have a command to rename sheet based on a cell value(Date) but the problem is whenever I copy another sheet it appear problem when i try to change the Date in Cell A1, reason is Cell Name is already taken. So is there a way to solve this problem ?
Code: Select all
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
For i = 1 To Sheets.Count
If Worksheets(i).Range("a1").Value <> "" Then
Sheets(i).Name = Format(Worksheets(i).Range("A1").Value, "dd-mm-yyyy")
End If
Next i
End Sub