Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
Worksheets.Add(After:=Sheets(Origsheet)).Name = "Fred" Where OrigSheet contains either an index number or a sheetname as a string. In article , "Chris Gorham" wrote: 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Simple problem, simple formula, no FUNCTION ! | Excel Worksheet Functions | |||
Simple problem | New Users to Excel | |||
Simple problem? | Excel Worksheet Functions | |||
Simple problem | Excel Discussion (Misc queries) | |||
Another simple little problem | Excel Programming |