+ Reply to Thread
Results 1 to 2 of 2

Help with simple copy worksheet macro

  1. #1
    Registered User
    Join Date
    01-14-2013
    Location
    Maine
    MS-Off Ver
    Excel 2007
    Posts
    53

    Help with simple copy worksheet macro

    Here is my code:

    ActiveWorkbook.Sheets(Titer).Copy after:=ActiveWorkbook.Sheets("Titer")

    This is linked to a worksheet button. If I hit the button, the worksheet is copied, named "Titer (2)" and placed after the original. If I hit the button again, "Titer (3)" is created and placed after the original worksheet. I want the new copy to always be placed after the last copy, i.e. I want "Titer (3)" to be placed after "Titer (2)" and not after "Titer".

    I was thinking this might need a for next loop, but I am not sure if that is right.

  2. #2
    Registered User
    Join Date
    01-14-2013
    Location
    Maine
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: Help with simple copy worksheet macro

    Never Mind I got it....

    ActiveWorkbook.Sheets(Titer).Copy after:=ActiveWorkbook.ActiveSheet

+ 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