View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Brad Vontur Brad Vontur is offline
external usenet poster
 
Posts: 6
Default A simple problem...

Try:

Private Sub CommandButton1_Click()
Dim shtNew As Worksheet
Set shtNew = ActiveWorkbook.Worksheets.Add
(After:=Worksheets(Worksheets.Count))
shtNew.Name = "New Sheet"
End Sub

HTH.

-Brad

-----Original Message-----
Hi,

just trying to add a worksheet behind an existing one and
naming it.
trying this:

Sheets.Add Type:=Worksheet, count:=1, after:=Sheets
(Origsheet)

but I'd like to assign a name to it (in the same
statement...must be possible..!!)

Thks

Chris
.