View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
cluckers cluckers is offline
external usenet poster
 
Posts: 31
Default add non active worksheet

it gets the compile error "variable not defined".

Dim startplace As Worksheet
Set startplace = ActiveSheet.Name
Worksheets.Add().Name = "Sheet2"
Sheets(startplace).Select

this code returns 'object required'


"Luke M" wrote:

You could get around not knowing what the current active sheet is by doing
this:

StartPlace = ActiveSheet.Name
Worksheets.Add().Name = "Sheet2"
Sheets(StartPlace).Select
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"cluckers" wrote:

How do I add a new sheet to my acitve workbook without makin it the active
sheet.

I tired

Worksheets.Add().Name = "Sheet2"

but it makes it active.
Normally I cold just active the other sheet but the primary sheet name will
not be consistent.