inserting worksheets

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

how would you simuletaneously insert three blank worksheets into a workbook
 
You could add the "Insert Worksheet" icon to your toolbar, and then ... 3
quick clicks.<g>
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
sugar said:
how would you simuletaneously insert three blank worksheets into a
workbook
 
sugar, one way with a macro,

Sub test()
Worksheets.Add Count:=3
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

sugar said:
how would you simuletaneously insert three blank worksheets into a
workbook
 
You would need a macro.

Sub Sheets_Add()
For i = 1 To 3
Sheets.Add
Next i
End Sub

If you wanted to get specific, you could give them names also.

Sub Add_Sheets()
For i = 3 To 1 Step -1
Worksheets.Add.Name = "sugar" & i
Next
End Sub


Gord Dibben MS Excel MVP
 
Hi Sugar,

Probably not helpful for this situation but just FYI you can set the default
number of worksheets in a new book at Tools>Options>General tab
and look for Sheets in new workbook.

HTH
Martin
 
Ragdyer said:
You could add the "Insert Worksheet" icon to your toolbar, and then ... 3
quick clicks.<g>
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

workbook

how do I add an icon to my toolbar
 
You could use a macro assigned to a button on a toolbar.

Two methods......................one fixed at three sheets, one with an inputbox
for a choice.

Sub Sheets_Insert3()
Dim i As Long
On Error GoTo endit
Application.ScreenUpdating = False
For i = 1 To 3
Sheets.Add
Next i
endit:
Application.ScreenUpdating = True
End Sub


Sub Sheets_Insert()
Dim i As Long
On Error GoTo endit
Application.ScreenUpdating = False
shts = InputBox("How many sheets", , 3) '3 is default
For i = 1 To shts
Worksheets.Add
Next i
endit:
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP
 

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