Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Does someone know how to insert a worksheet into a workbook using VBA.
I need to insert a sheet called "Duplicate" on the fly is does not already exist. Does anyone know how? tahnks & regards J |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim sh as Worksheet
On Error Resume Next set sh = Worksheets("Duplicate") On Error goto 0 if sh is nothing then set sh = worksheets.Add(After:=Worksheets(worksheets.count) ) End if Sh.Activate -- Regards, Tom Ogilvy "JP SIngh" wrote in message ... Does someone know how to insert a worksheet into a workbook using VBA. I need to insert a sheet called "Duplicate" on the fly is does not already exist. Does anyone know how? tahnks & regards J |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Option Explicit Sub TEST() Dim SHT As Object On Error Resume Next Set SHT = Sheets("Duplicate") On Error GoTo 0 If SHT Is Nothing Then Set SHT = Worksheets.Add(After:=Worksheets(Worksheets.Count) ) SHT.Name = "Duplicate" End If SHT.Activate End Sub -- Regards, Soo Cheon Jheong _ _ ^ąŻ^ -- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
insert row / insert column command buttons | Excel Worksheet Functions | |||
How can I insert a date with an icon (calendar) insert | Excel Discussion (Misc queries) | |||
unable to insert columns in excel, insert- columns (disabled) | Excel Discussion (Misc queries) | |||
Can I auto insert a worksheet when I insert a value in a cell. | Excel Worksheet Functions | |||
Insert Next? Or insert a variable number of records...how? | Excel Discussion (Misc queries) |