Results 1 to 8 of 8

cut and copy an entire row based on value in a cell

Threaded View

  1. #1
    Registered User
    Join Date
    10-04-2013
    Location
    Ferryhill
    MS-Off Ver
    Excel 2010
    Posts
    25

    cut and copy an entire row based on value in a cell

    Hi,

    I have a spread sheet containing a list of tasks. The first sheet is called "Press Shop", I also have a sheet called "archive". When a task is complete, column J is set to complete. I am looking for some code that will cut this entire row out of the "Press Shop" sheet, move the cells up, and copy it to the bottom of the list in "archive".

    Can anyone help me please?

    Code I have so far.

    Sub As_Of_Analysis_Sorting()

    Dim lr As Long
    Dim lr2 As Long
    Dim r As Long

    lr = Sheets("Press Shop").Cells(Rows.Count, "A").End(xlUp).Row
    lr2 = Sheets("Archived Changes").Cells(Rows.Count, "A").End(xlUp).Row

    For r = lr To 2 Step -1
    If Range("J" & r).Value = "Complete" Then
    Rows(r).Copy Destination:=Sheets("Archived Changes").Range("A" & lr2 + 1)
    lr2 = Sheets("Archived Changes").Cells(Rows.Count, "A").End(xlUp).Row
    End If
    Next r

    End Sub
    It's repeating some rows twice, and obviously not deleting rows yet


    Thanks
    Last edited by michaelcouch87; 11-26-2013 at 04:56 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. vba - copy entire row based on cell value
    By Zygoid in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-23-2013, 12:25 PM
  2. [SOLVED] Copy entire row to appropriate sheet based on value of cell in row E
    By engineerjason in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 11-12-2012, 07:48 PM
  3. Copy/Cut entire row to another sheet based on cell value
    By excelkeechak in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-02-2010, 04:23 PM
  4. How do you copy an entire row in excel to a new tab based on a cell value
    By pklimchuk in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 10-20-2010, 04:42 AM
  5. How do you copy an entire row in excel to a new tab based on a cell value
    By pklimchuk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-08-2010, 01:03 PM

Tags for this Thread

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