I have over 300 sheets whose name needs to be changed as the first cell (A1).
I initially tried to write code from the internet
<code>Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Name = Range("A1")
End Sub
</code>
<code>Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Name = Range("A1")
End Sub
</code>
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Name = Range("A1")
End Sub
It worked for only one sheet. I want to apply it to all.
<code>`Sub vba_loop_sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Name = Range("A1")
End Sub
`
</code>
<code>`Sub vba_loop_sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Name = Range("A1")
End Sub
`
</code>
`Sub vba_loop_sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Name = Range("A1")
End Sub
`
So I tried this but it didnt work. Please help
New contributor
Inquisitive_COder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.