+ Reply to Thread
Results 1 to 5 of 5

Need macro to move row to another worksheet within the workbook

  1. #1
    Forum Contributor
    Join Date
    05-18-2012
    Location
    Chicopee, Ma
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    196

    Need macro to move row to another worksheet within the workbook

    Help!
    I'm trying to create a macro to cut a row from one worksheet and move it to an archive work sheet.
    I've used macro record to cut and past but when I cut and past another row, it wipes out the first one I archived. This is what I have so far

    Sub archive()
    '
    ' archive Macro
    '
    ' Keyboard Shortcut: Ctrl+Shift+A
    '
    Rows("2:2").Select
    Selection.Cut
    Sheets("Archive").Select
    Rows("2:2").Select
    ActiveSheet.Paste
    Rows("3:3").Select
    Sheets("work orders").Select
    Selection.Delete Shift:=xlUp
    End Sub

  2. #2
    Forum Contributor
    Join Date
    05-04-2012
    Location
    Stamford,Connecticut,USA
    MS-Off Ver
    Excel 2003
    Posts
    105

    Re: Need macro to move row to another worksheet within the workbook

    Try this
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    05-18-2012
    Location
    Chicopee, Ma
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    196

    Re: Need macro to move row to another worksheet within the workbook

    I tried to get your example to work, maybe I'm doing omething wrong, kept getting an error.
    I'm attaching an example of my spreadsheet, the macro I recorded soes what I want up to a point. It takes information from one page and puts it in another but when I repeat the process itt erases the previous line. All I want to do is add in code to move information to the archive adding the lines under the last copied. By the way, thank you for your help.

    Matt
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Need macro to move row to another worksheet within the workbook

    Hi

    What is the condition to cut and paste rows...
    Click *, if my suggestion helps you. Have a good day!!

  5. #5
    Forum Contributor
    Join Date
    05-18-2012
    Location
    Chicopee, Ma
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    196

    Re: Need macro to move row to another worksheet within the workbook

    yes, I am cutting the row from one sheet and trying to archive it in another. I used macro recorder, I'm looking for a way to put the next cut row under the one that was archived. Right now my macro puts the new row in place of the old on on the archive sheet.

+ 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