Thread: Create New Wk
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Piotr Lipski Piotr Lipski is offline
external usenet poster
 
Posts: 36
Default Create New Wk

On Thu, 29 Jun 2006 08:38:36 -0500, halem2 wrote:

Hi folks:

I have an Excel file with a list of 150 names or more, one name per
cell in column A. This list changes weekly. I need to create a
workbook with using those names one name per worksheet, meaning each
tab name in the new workbook would be the list.

Any thoughts?

thanks in advance :)


Sub GenerateWB()
Dim rng As Excel.Range
Dim wkb As Excel.Workbook
Workbooks.Add
Set wkb = ActiveWorkbook
Set rng = Me.Range("A1")
Do While rng.Value < ""
wkb.Sheets.Add
wkb.ActiveSheet.Name = rng.Value
Set rng = rng.Offset(1, 0)
Loop
End Sub

--
PL