Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Adding new worksheet BEFORE 1st worksheet

I am calling several macros

the last of which is:

Sub summary()
Sheets.Add.Name = "1 day moves"
Sheets.Add.Name = "3 day moves"
End Sub

this inserts the 2 new worksheets BEFORE the very last sheet

how can I insert these BEFORE a specific worksheet called "template"

thank you
Rob
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Adding new worksheet BEFORE 1st worksheet

Try this..

Sheets.Add Befo=Sheets(1)
Sheets(1).name = "NewSheet"

--
If this post helps click Yes
---------------
Jacob Skaria


"Rob P" wrote:

I am calling several macros

the last of which is:

Sub summary()
Sheets.Add.Name = "1 day moves"
Sheets.Add.Name = "3 day moves"
End Sub

this inserts the 2 new worksheets BEFORE the very last sheet

how can I insert these BEFORE a specific worksheet called "template"

thank you
Rob

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Adding new worksheet BEFORE 1st worksheet

On Apr 21, 10:41*am, Rob P wrote:
I am calling several macros

the last of which is:

* * * * * Sub summary()
* * * * * * * Sheets.Add.Name = "1 day moves"
* * * * * * * Sheets.Add.Name = "3 day moves"
* * * * * End Sub

this inserts the 2 new worksheets BEFORE the very last sheet

how can I insert these BEFORE a specific worksheet called "template"

thank you
Rob


Try this...

Sub summary()
Sheets.Add.Name = "1 day moves"
Sheets.Add.Name = "3 day moves"
Sheets("1 day moves").Move Sheets("template")
Sheets("3 day moves").Move Sheets("template")
End Sub
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Adding new worksheet BEFORE 1st worksheet

Sorry I thought you are looking to insert as the first sheet. The below will
insert before 'Template'

Worksheets.Add(Befo=Worksheets(Sheets("template ").Index)).Name = "MySheet1"


--
If this post helps click Yes
---------------
Jacob Skaria


"Rob P" wrote:

I am calling several macros

the last of which is:

Sub summary()
Sheets.Add.Name = "1 day moves"
Sheets.Add.Name = "3 day moves"
End Sub

this inserts the 2 new worksheets BEFORE the very last sheet

how can I insert these BEFORE a specific worksheet called "template"

thank you
Rob

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
adding several worksheet cells onto a main worksheet oxicottin Excel Worksheet Functions 2 September 20th 06 08:07 PM
Adding worksheet tab names to the first worksheet adam Excel Discussion (Misc queries) 1 May 17th 06 02:07 AM
list worksheet macros/VBA without adding worksheet br549 Excel Discussion (Misc queries) 0 January 6th 06 10:17 PM
Activate Previous worksheet after adding a new worksheet [email protected] Excel Programming 3 October 19th 05 01:01 AM
XL VBA adding new worksheet if current worksheet is not empty Lance Hoffmeyer Excel Programming 4 August 27th 04 07:15 AM


All times are GMT +1. The time now is 03:48 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"