+ Reply to Thread
Results 1 to 8 of 8

Sheet Copy After:

  1. #1
    asmenut
    Guest

    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. #2
    Bernie Deitrick
    Guest

    Re: Sheet Copy After:

    asmenut,

    There is an "After" option, too:

    ActiveSheet.Copy After:=ActiveSheet

    HTH,
    Bernie
    MS Excel MVP

    "asmenut" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #3
    Ron de Bruin
    Guest

    Re: Sheet Copy After:

    Hi

    Try this

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


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



    "asmenut" <[email protected]> wrote in message
    news:[email protected]...
    >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. #4
    Bernie Deitrick
    Guest

    Re: 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
    news:[email protected]...
    > asmenut,
    >
    > There is an "After" option, too:
    >
    > ActiveSheet.Copy After:=ActiveSheet
    >
    > HTH,
    > Bernie
    > MS Excel MVP
    >
    > "asmenut" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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. #5
    Dave Peterson
    Guest

    Re: 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" <[email protected]> wrote in message
    > news:[email protected]...
    > >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. #6
    Ron de Bruin
    Guest

    Re: Sheet Copy After:

    You are right Dave (as always<g>)

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



    "Dave Peterson" <[email protected]> wrote in message
    news:[email protected]...
    > 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" <[email protected]> wrote in message
    >> news:[email protected]...
    >> >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




  7. #7
    Dave Peterson
    Guest

    Re: 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" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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" <[email protected]> wrote in message
    > >> news:[email protected]...
    > >> >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

  8. #8
    Ron de Bruin
    Guest

    Re: Sheet Copy After:

    > Youngster!

    LOL

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



    "Dave Peterson" <[email protected]> wrote in message
    news:[email protected]...
    > Youngster!
    >
    > Ron de Bruin wrote:
    >>
    >> You are right Dave (as always<g>)
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >> "Dave Peterson" <[email protected]> wrote in message
    >> news:[email protected]...
    >> > 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" <[email protected]> wrote in message
    >> >> news:[email protected]...
    >> >> >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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1