ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help to create worksheets from a list (https://www.excelbanter.com/excel-programming/411208-help-create-worksheets-list.html)

Les

Help to create worksheets from a list
 
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.
--
Les

Sam Wilson

Help to create worksheets from a list
 
Try This:

Sub sheets()

Dim ws As Worksheet
Dim x As Integer

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

End Sub


"Les" wrote:

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.
--
Les


Les

Help to create worksheets from a list
 
100%, Thanks Sam
--
Les


"Sam Wilson" wrote:

Try This:

Sub sheets()

Dim ws As Worksheet
Dim x As Integer

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

End Sub


"Les" wrote:

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.
--
Les



All times are GMT +1. The time now is 03:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com