What I'm looking for is a code that will name a Sheet Tab whatever is in cell A8 of that same sheet.
I don't want all sheets in the workbook named this way only a few.
The name that appears in cell A8 is the result of a formula ( it hasn't been typed in ) i don't know if that makes any difference to the code needed
I've read numerous reviews of this topic and am trying to use the followng code ..
Sub NameSheets()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Name = ws.Range("a1")
Next ws
End Sub
however it doesn't seem to be doing anything and I suspect it's trying to name all sheets in the workbook .. I don't want that.
Can you please be specific as to where I need to paste the code, eg: is it in Module for that sheet or Class Module etc etc etc you can see I'm a newbie to VBA
sorry
I don't want all sheets in the workbook named this way only a few.
The name that appears in cell A8 is the result of a formula ( it hasn't been typed in ) i don't know if that makes any difference to the code needed
I've read numerous reviews of this topic and am trying to use the followng code ..
Sub NameSheets()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Name = ws.Range("a1")
Next ws
End Sub
however it doesn't seem to be doing anything and I suspect it's trying to name all sheets in the workbook .. I don't want that.
Can you please be specific as to where I need to paste the code, eg: is it in Module for that sheet or Class Module etc etc etc you can see I'm a newbie to VBA
sorry