Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Sheet Copy After:

I have a workbook that contains 5 sheets. From time to time the user will
need to add a sheet after the active sheet.

I know that there is a "Before" option, but is there a way that I can code
(VBA) a way to insert the new sheet "After" the activesheet?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Sheet Copy After:

asmenut,

There is an "After" option, too:

ActiveSheet.Copy After:=ActiveSheet

HTH,
Bernie
MS Excel MVP

"asmenut" wrote in message
...
I have a workbook that contains 5 sheets. From time to time the user will
need to add a sheet after the active sheet.

I know that there is a "Before" option, but is there a way that I can code
(VBA) a way to insert the new sheet "After" the activesheet?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Sheet Copy After:

Hi

Try this

Worksheets.Add after:=Worksheets(ActiveSheet.Index)


--
Regards Ron de Bruin
http://www.rondebruin.nl



"asmenut" wrote in message
...
I have a workbook that contains 5 sheets. From time to time the user will
need to add a sheet after the active sheet.

I know that there is a "Before" option, but is there a way that I can code
(VBA) a way to insert the new sheet "After" the activesheet?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Sheet Copy After:

I'm sorry, I had a slight brain-freeze, and morphed your question from
adding to copying. I should have shown:

Sheets.Add Type:="Worksheet", After:=ActiveSheet

HTH,
Bernie
MS Excel MVP

"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
asmenut,

There is an "After" option, too:

ActiveSheet.Copy After:=ActiveSheet

HTH,
Bernie
MS Excel MVP

"asmenut" wrote in message
...
I have a workbook that contains 5 sheets. From time to time the user

will
need to add a sheet after the active sheet.

I know that there is a "Before" option, but is there a way that I can

code
(VBA) a way to insert the new sheet "After" the activesheet?





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Sheet Copy After:

Or this...

Worksheets.Add after:=ActiveSheet

(maybe better if you have non-worksheets in the workbook)

Ron de Bruin wrote:

Hi

Try this

Worksheets.Add after:=Worksheets(ActiveSheet.Index)

--
Regards Ron de Bruin
http://www.rondebruin.nl

"asmenut" wrote in message
...
I have a workbook that contains 5 sheets. From time to time the user will
need to add a sheet after the active sheet.

I know that there is a "Before" option, but is there a way that I can code
(VBA) a way to insert the new sheet "After" the activesheet?


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Sheet Copy After:

Youngster!

Ron de Bruin wrote:

You are right Dave (as always<g)

--
Regards Ron de Bruin
http://www.rondebruin.nl

"Dave Peterson" wrote in message
...
Or this...

Worksheets.Add after:=ActiveSheet

(maybe better if you have non-worksheets in the workbook)

Ron de Bruin wrote:

Hi

Try this

Worksheets.Add after:=Worksheets(ActiveSheet.Index)

--
Regards Ron de Bruin
http://www.rondebruin.nl

"asmenut" wrote in message
...
I have a workbook that contains 5 sheets. From time to time the user
will
need to add a sheet after the active sheet.

I know that there is a "Before" option, but is there a way that I can
code
(VBA) a way to insert the new sheet "After" the activesheet?


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Sheet Copy After:

Youngster!

LOL

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Dave Peterson" wrote in message
...
Youngster!

Ron de Bruin wrote:

You are right Dave (as always<g)

--
Regards Ron de Bruin
http://www.rondebruin.nl

"Dave Peterson" wrote in message
...
Or this...

Worksheets.Add after:=ActiveSheet

(maybe better if you have non-worksheets in the workbook)

Ron de Bruin wrote:

Hi

Try this

Worksheets.Add after:=Worksheets(ActiveSheet.Index)

--
Regards Ron de Bruin
http://www.rondebruin.nl

"asmenut" wrote in message
...
I have a workbook that contains 5 sheets. From time to time the user
will
need to add a sheet after the active sheet.

I know that there is a "Before" option, but is there a way that I
can
code
(VBA) a way to insert the new sheet "After" the activesheet?

--

Dave Peterson


--

Dave Peterson



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
copy rows from one Data sheet to another sheet based on cell conte John McKeon Excel Discussion (Misc queries) 2 May 15th 10 06:49 AM
Copy Sheet to new Sheet and clear cells on original sheets Boiler-Todd Excel Discussion (Misc queries) 7 September 23rd 09 10:02 PM
Auto Copy/autofill Text from sheet to sheet if meets criteria Joyce Excel Discussion (Misc queries) 0 November 20th 08 11:05 PM
relative sheet references ala sheet(-1)!B11 so I can copy a sheet. RonMc5 Excel Discussion (Misc queries) 9 February 3rd 05 12:51 AM
providing a sheet-copy event or copy CustomProperties Carlos Cortes Excel Programming 2 November 11th 04 08:24 AM


All times are GMT +1. The time now is 01:35 AM.

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"