![]() |
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? |
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? |
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? |
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? |
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 |
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 |
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 |
All times are GMT +1. The time now is 06:09 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com