Naming multiple sheets in a workbook using cells within the workbo
do you mean on one sheet you have a list of names and you want to name the
sheets using this list?
You will find the most basic of clearly stated explanations will often be
the most productive.
Assume the above - a list of names on worksheet Sheet1 in A1 to A10 (10
sheets in the workbook)
Sub NameSheets()
Dim i as Long, cell as Range
i = 0
for each cell in worksheets("Sheet1").Range("A1:A10")
i = i + 1
worksheets(i).Name = cell.Value
Next
End Sub
This further assumes that you don't already have sheets in other positions
with these names thus creating a possible duplicate name situation.
the other pssible assumption is that you have the intended name of the sheet
in cell A1 of each sheet
Sub NameSheets()
for each sh in Worksheets
sh.Name = sh.Range("A1").Value
Next
end Sub
or for multiple cells (assume A1 and C3
Sub NameSheets()
for each sh in Worksheets
sh.Name = sh.Range("A1").Value & sh.Range("C3").Value
Next
end Sub
--
Regards,
Tom Ogilvy
"amyc" wrote in message
...
I have tried various codes given out on this site already with no luck. I
am
able to change the name using the most basic of code and assigning a
value,
however I need the worksheets to pull from multiple cells in a worksheet.
Basically mirroring the name of the data within. I would prefer the most
basic of codes as I am not familiar with this. Can anyone help? thanks
|