Auto-naming of Sheets ?

A

Anthony Slater

Hi

I have a list of numbers all 8 digits in length (roughly
200 numbers).
I need a seperate worksheet for each number.

Is there a way of taking each number, inserting a
worksheet and naming it according to the number?

Thanks in advance
 
A

Anthony Slater

Thanks for that Andy.

Some good features there..
-----Original Message-----
Hi

This is one of the features of an add-in from www.asap- utilities.com It has
load of other useful functions too.

--
Andy.





.
 
S

Stefan Hägglund [MSFT]

Hi!

Copy the macro below to a new module, then select all cells with the names
in the sheet and run the macro.

Sub AddAndNameSheets()
Dim Cell As Object
For Each Cell In Selection
Sheets.Add
ActiveSheet.Name = Cell.Value
Next
End Sub

Best regards

Stefan Hägglund
Microsoft
 
J

JulieD

Hi Anthony

this can be done using the following code ..

Sub makesheets()
Dim myrange As Range

Set myrange = Sheets("Sheet4").Range("A1:A210")

For Each c In myrange
Worksheets.Add
ActiveSheet.Name = c.Value
Next
End Sub

_______

where Sheet4 range A1:A210 is where the list of your 200 names are stored.

to use the code, right mouse click on a sheet tab, choose view code, choose
insert module from the menu, ... in the sheet of paper that comes up on the
right hand side of the screen, copy & paste the above in

Please let us know how you go
Cheers
JulieD
 
Top