Creating Sheets in a present Xl File

  • Thread starter Thread starter anil
  • Start date Start date
A

anil

In the main Sheet i.e sheet1 i have a data of 10 names, and now i want
to create 10 sheets in the same xl file with the sheet name as the
above 10 names
 
Hi Anil try this,

Sub TEST()

Dim s As Worksheet
Set s = ActiveSheet

For i = 1 To s.Range("A65536").End(xlUp).Row

Sheets.Add
ActiveSheet.Name = s.Cells(i, 1)

Next i
s.Select

End Sub


Regards
Ankur
www.xlmacros.com
 
Hi

Quickest way would be to select the cells with the 10 names (asuming
there are no duplicates, and no existing sheet names with the same name
as one of the 10) and go Alt+F11 (opening up the VBE), Ctrl+G to get
the Immediate Window and paste the following line in:

For Each c in selection:set nw =worksheets.Add:nw.name = c.value:next

and press return.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top