Sheet Copy After:

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
asmenut,

There is an "After" option, too:

ActiveSheet.Copy After:=ActiveSheet

HTH,
Bernie
MS Excel MVP
 
Hi

Try this

Worksheets.Add after:=Worksheets(ActiveSheet.Index)
 
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
 
Or this...

Worksheets.Add after:=ActiveSheet

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top