+ Reply to Thread
Results 1 to 9 of 9

Macro that copies sheet and places after the copied sheet every time

Hybrid View

  1. #1
    Registered User
    Join Date
    02-16-2015
    Location
    Australia
    MS-Off Ver
    2012 on mac
    Posts
    38

    Macro that copies sheet and places after the copied sheet every time

    Hi, I am pulling my hair out again trying to build a macro that copies a sheet and places it AFTER the copied sheet every time. Any help would be appreciated

    Edit: I forgot to mention the sheet does not need to be renamed after its copied.
    Last edited by goatie43; 03-07-2015 at 12:54 PM. Reason: information

  2. #2
    Registered User
    Join Date
    01-09-2011
    Location
    Gabrieola
    MS-Off Ver
    2003,2007
    Posts
    42

    Re: Macro that copies sheet and places after the copied sheet every time

    Let's see the code

  3. #3
    Registered User
    Join Date
    02-16-2015
    Location
    Australia
    MS-Off Ver
    2012 on mac
    Posts
    38

    Re: Macro that copies sheet and places after the copied sheet every time

    Sub CopyRename()
        Dim sName As String
        Dim wks As Worksheet
        Worksheets("SETUP SHEET").Copy after:=sheet
        Set wks = ActiveSheet
        Do While sName <> wks.Name
            sName = Application.InputBox _
              (Prompt:="Place Sheet Name")
            On Error Resume Next
            wks.Name = sName
            On Error GoTo 0
        Loop
        Set wks = Nothing
    End Sub

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Macro that copies sheet and places after the copied sheet every time

        Worksheets("SETUP SHEET").Copy after:=Sheets(Sheets.Count)
    Last edited by davesexcel; 03-07-2015 at 01:01 PM.

  5. #5
    Registered User
    Join Date
    02-16-2015
    Location
    Australia
    MS-Off Ver
    2012 on mac
    Posts
    38

    Re: Macro that copies sheet and places after the copied sheet every time

    Hi Dave, this is what i had originally but not what i was looking for. Tanks for the input.

  6. #6
    Registered User
    Join Date
    02-16-2015
    Location
    Australia
    MS-Off Ver
    2012 on mac
    Posts
    38

    Re: Macro that copies sheet and places after the copied sheet every time

    The sheet I'm trying to copy is in the middle of my 40 tab workbook, and the sheet that i copy is in the middle so if i can get it to place exactly after the copied sheet that would be great. But i suck at this....

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Macro that copies sheet and places after the copied sheet every time

    Hmmm... what indicates the sheet, or do you know exactly how many sheets from the last sheet?

    Are you copying a sheet , and want it next to the sheet your copying?
    Last edited by davesexcel; 03-07-2015 at 02:23 PM.

  8. #8
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Macro that copies sheet and places after the copied sheet every time

        Worksheets("SETUP SHEET").Copy after:=Sheets("SETUP SHEET")

  9. #9
    Registered User
    Join Date
    02-16-2015
    Location
    Australia
    MS-Off Ver
    2012 on mac
    Posts
    38

    Re: Macro that copies sheet and places after the copied sheet every time

    Quote Originally Posted by davesexcel View Post
        Worksheets("SETUP SHEET").Copy after:=Sheets("SETUP SHEET")
    Sorry for the late reply just got back from work, This is what i ended up using thanks Dave!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 05-01-2013, 12:26 PM
  2. Copy sheet to another WB and macro copies that data to last row of master sheet
    By nickmax1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-19-2013, 06:31 PM
  3. [SOLVED] Macro That Automatically Copies Row from Sheet 1 into Sheet 2 Based on Info in that Row
    By smartmika in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-27-2012, 10:52 AM
  4. Replies: 6
    Last Post: 07-25-2012, 07:55 AM
  5. Macro that copies info from sheet 1 to sheet 2 and goes to next available row
    By excel1191 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-29-2011, 12:39 AM

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