+ Reply to Thread
Results 1 to 4 of 4

Excel Move Row to Sheet2 and Append

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-03-2012
    Location
    Washington State
    MS-Off Ver
    Excel 365
    Posts
    340

    Excel Move Row to Sheet2 and Append

    Hello, I have some code that I found to 'cut & paste' a row of data from Sheet1 to Sheet2 which works great. The problem is, how do I get the code to append the data row by row? It will just replace the data right now. Any help is greatly appreciated.

    
    Sub MoveActiveRow()
    
      Application.ScreenUpdating = False
         
        Dim strSheetName, strCellAddress As String
        strSheetName = ActiveSheet.Name
        strCellAddress = ActiveCell.Address(False, False)
         
        Rows(ActiveCell.Row).Cut
        Sheets("Historical Record").Select 'Change sheet name to whatever consolidated tab name is.
        Range("A" & Range("A65536").End(xlUp).Row).Select
        ActiveSheet.Paste
        Application.CutCopyMode = False
         
        Range("A" & ActiveCell.Row).Select
         
        Sheets(strSheetName).Select
        Range(strCellAddress).Select
         
        Rows(ActiveCell.Row).Delete
         
        Application.ScreenUpdating = True
    End Sub

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Excel Move Row to Sheet2 and Append

    Try something like this...

    Sub MoveActiveRow()
    
        Application.ScreenUpdating = False
    
        ActiveCell.EntireRow.Copy Destination:=Sheets("Historical Record").Range("A" & Rows.Count).End(xlUp).Offset(1)
        ActiveCell.EntireRow.Delete
        
        Application.ScreenUpdating = True
        
    End Sub

  3. #3
    Forum Contributor
    Join Date
    01-26-2012
    Location
    Mumbai
    MS-Off Ver
    Excel 2013
    Posts
    154

    Re: Excel Move Row to Sheet2 and Append

    Post your input file ,i will post a solution .

  4. #4
    Forum Contributor
    Join Date
    04-03-2012
    Location
    Washington State
    MS-Off Ver
    Excel 365
    Posts
    340

    Re: Excel Move Row to Sheet2 and Append

    AlphaFrog

    This works like a charm... exactly what I needed. Thanks very much for your help and time.

+ 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