View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
control freak control freak is offline
external usenet poster
 
Posts: 7
Default How to create workbook with multiple sheets

I need to copy a certain sheet in my workbook a number of times to a
new workbook, I can do this with this code to a point i get errors,
sort of new to excel macros. not sure how to place the saveworkbook
command (without it i can copy multiple sheets(according to list) in
the same workbook, but i need to create a new workbook with the
multiple worksheet copies.

Private Sub CommandButton1_Click()
With Worksheets("START")
For Each cell In .Range(.Cells(1, 1), .Cells(Rows.Count, 1).End(xlUp))
If Not IsEmpty(cell) Then
Worksheets("template").Copy After:=Worksheets(Worksheets.Count)
ActiveSheet.Name = cell.Value
End If
Next
End With
ActiveWorkbook.SaveAs Filename:="NewFile.xls", _
FileFormat:=xlNormal
End Sub


any hints.

Thanks