Add a worksheet using VBA

  • Thread starter Thread starter Alan L. Wagoner
  • Start date Start date
A

Alan L. Wagoner

I have a bunch of names in Sheet1, and would like to create a worksheet
programmatically for each name.

Sheet1 looks like:
Joe
Bob
Judy
Ann
....

Any suggestions would be greatly appreciated.

Regards,
Alan
 
One way:

Public Sub AddSheets()
Dim rCell As Range
For Each rCell In Sheets("Sheet1").Range("A1:A" & _
Range("A" & Rows.Count).End(xlUp).Row)
Worksheets.Add(After:=Sheets(Sheets.Count)).Name = _
rCell.Value
Next rCell
End Sub
 

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

Back
Top