inserting worksheets

R

Ragdyer

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
 
P

Paul B

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
 
G

Gord Dibben

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
 
M

MartinW

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
 
T

TonyK

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
 
G

Gord Dibben

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
 
Top