Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default add non active worksheet

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default add non active worksheet

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.

  #3   Report Post  
Posted to microsoft.public.excel.misc
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.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default add non active worksheet

Dim startplace As String
startplace = ActiveSheet.Name
Worksheets.Add().Name = "Sheet14"
Sheets(startplace).Select


Gord Dibben MS Excel MVP

On Thu, 20 Aug 2009 13:17:01 -0700, cluckers
wrote:

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.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying the active worksheet to another worksheet in the same work queenmaam Excel Worksheet Functions 5 March 25th 08 06:56 PM
E-mailing the active worksheet GrahamB Excel Worksheet Functions 5 February 21st 07 09:48 PM
name an active worksheet djshides via OfficeKB.com Excel Worksheet Functions 1 September 29th 06 12:17 AM
how can I get the name of the active worksheet? Mark Dvorkin Excel Worksheet Functions 3 November 4th 05 02:46 AM
email active worksheet es Excel Discussion (Misc queries) 2 January 31st 05 02:59 PM


All times are GMT +1. The time now is 02:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"