Help to create worksheets from a list

  • Thread starter Thread starter Les
  • Start date Start date
L

Les

Hi all, i have a list of names in the cells "AQ1:AQ10) and i would like to
add a sheet to the workbook for each name & would like to name that sheet
with the respective name with VBA.

Any help would be much appreciated.
 
Try This:

Sub sheets()

Dim ws As Worksheet
Dim x As Integer

Do Until IsEmpty(Worksheets("YOURSHEETNAME").Range("aq1").Offset(x, 0))
Set ws = Worksheets.Add
ws.Name = Worksheets("YOURSHEETNAME").Range("aq1").Offset(x, 0).Value
x = x + 1
Loop

End Sub
 
100%, Thanks Sam
--
Les


Sam Wilson said:
Try This:

Sub sheets()

Dim ws As Worksheet
Dim x As Integer

Do Until IsEmpty(Worksheets("YOURSHEETNAME").Range("aq1").Offset(x, 0))
Set ws = Worksheets.Add
ws.Name = Worksheets("YOURSHEETNAME").Range("aq1").Offset(x, 0).Value
x = x + 1
Loop

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