Insert multi spreadsheet

  • Thread starter Thread starter inungh
  • Start date Start date
I

inungh

I need insert about 20 spreadsheet for my report every day.
I just wanted to know is it possible to insert all 20 pages in one
shot?

Your information is great appreciated,
 
I need insert about 20 spreadsheet for my report every day.
I just wanted to know is it possible to insert all 20 pages in one
shot?

Your information is great appreciated,
Inungh,

Use the count argument of the Add method for worksheets, e.g.
Worksheets.Add Count:=20.

Best,

Matt Herbert
 
Inungh,

Use the count argument of the Add method for worksheets, e.g.
Worksheets.Add Count:=20.

Best,

Matt Herbert

Thanks again,
I would like to rename all the spreadsheet from a list of cells.
Can you please show me how to rename the spreadsheet?

Thanks again,
 
something like following may do what you want:

Sub AddSheets()
Dim sheetname As Range
Dim NewWs As Worksheet

With ThisWorkbook

For na = 1 To 20

'the worksheet & range where list of names are stored
'change as required
Set sheetname = .Worksheets("Sheet1").Range("A" & na)

If Not IsEmpty(sheetname.Value) Then

Set NewWs = .Worksheets.Add

NewWs.Move After:=.Worksheets(.Worksheets.Count)

NewWs.Name = sheetname.Value

End If

Next

End With

End Sub

I have assumed your sheet names are in Col A of worksheet named Sheet1.
Change as required.
 
something like following may do what you want:

Sub AddSheets()
    Dim sheetname As Range
    Dim NewWs As Worksheet

    With ThisWorkbook

        For na = 1 To 20

            'the worksheet & range where list of names are stored
            'change as required
            Set sheetname = .Worksheets("Sheet1").Range("A"& na)

            If Not IsEmpty(sheetname.Value) Then

                Set NewWs = .Worksheets.Add

                NewWs.Move After:=.Worksheets(.Worksheets.Count)

                NewWs.Name = sheetname.Value

            End If

            Next

        End With

    End Sub

I have assumed your sheet names are in Col A of worksheet named Sheet1.
Change as required.
--
jb







- Show quoted text -

Thanks millions,
 
Back
Top