Renaming Sheets
On Aug 15, 7:01*am, Accor wrote:
Is there a short way to rename sheet1, sheet2, sheet3....sheet20 without
having to select one by one.
Many thanks *
There are many ways but my first question would be what do you want to
name the worksheets? Do you have a list somewhere with the desired
names or is it one name that is incremented numerically?
if it's the former see below - NOTE:Cut from the archives;
<snip1
"The following example has the sheet names in cells A2:A8
inclusive. This will create sheets with the names as per
the cells. It should be easy enough to modify. For
example, once you load the array, you can clean out the
names from the source sheet. If you want the sheets in a
different order, reverse the array selection, or put them
in the source sheet in the reverse order.
Tony
Sub bbb()
Dim arr As Variant
arr = Range("a4:a8").Value
For i = LBound(arr) To UBound(arr)
Set NewSheet = Sheets.Add
NewSheet.Name = arr(i, 1)
Next i
End Sub
</snip1
|