Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to copy a worksheet and place it after an existing worksheet, then
assign the new worksheet to an object variable but can't get my head around the code today. Here is what I have so far: Set NewWS = Worksheets(BackupWS).Copy(After:=Sheets("Summary") ) NewWS.Name = ws.Name The above is obviously flawed as it doesn't work for me. XL2002 SP2 Win2K Pro -- | +--Thief_ | |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
try this.... Worksheets(BackupWS).Copy , Sheets("Summary") Set NewWS = Activesheet Hth OJ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim WS As Worksheet
Set WS = Worksheets.Add(After:=Worksheets(Worksheets.Count) ) With WS .Name = "MynewSheet" ''' more such stuff, eg With .Range("C6: K20") .Interior.colorindex = 34 End With End With Patrick Molloy Microsoft Excel MVP "Thief_" wrote: I want to copy a worksheet and place it after an existing worksheet, then assign the new worksheet to an object variable but can't get my head around the code today. Here is what I have so far: Set NewWS = Worksheets(BackupWS).Copy(After:=Sheets("Summary") ) NewWS.Name = ws.Name The above is obviously flawed as it doesn't work for me. XL2002 SP2 Win2K Pro -- | +--Thief_ | |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I assign a macro to a graphic object on the worksheet | Excel Discussion (Misc queries) | |||
Object Variable Not Set Error on Selection object | Excel Worksheet Functions | |||
FileSearch Object - Cannot assign to variable | Excel Programming | |||
Run-time error '91': "Object variable or With block variable not set | Excel Programming | |||
Cells.Find error Object variable or With block variable not set | Excel Programming |