Hi,
I'm creating a template to keep track of student progress, and I want to create a macro to automatically name each sheet based on values input into an overview sheet.
I started with code I found from ExtendOffice: How to name sheets based on cell values, and updated the code to this
I'm not sure why but I cannot get this code to work. If I take out the Worksheets("Overview"), and assign the range to a cell within the sheet I'm trying to name, it works fine.
Any help would be appreciated!
I'm creating a template to keep track of student progress, and I want to create a macro to automatically name each sheet based on values input into an overview sheet.
I started with code I found from ExtendOffice: How to name sheets based on cell values, and updated the code to this
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Set Target = Worksheets("Overview").Range("A5")
If Target = "" Then Exit Sub
Application.ActiveSheet.Name = VBA.Left(Target, 31)
Exit Sub
End Sub
I'm not sure why but I cannot get this code to work. If I take out the Worksheets("Overview"), and assign the range to a cell within the sheet I'm trying to name, it works fine.
Any help would be appreciated!