none
move row from sheet 1 to sheet 2 if value in a cell equals X RRS feed

  • Question

  • As title implies I would like to move the values of a row from one sheet to another sheet is the value of a given cell is X.

    Scenario is as follows:

    I register a list of TASKS in column A and use the next column B to define a STATUS for the various tasks.(Create a drop down list with predefined status values). If the value of a cell in column B (STATUS) is e.g. COMPLETED, I want that row of values to be transfered to the next sheet.

    Anyone?

    Friday, September 4, 2015 9:58 PM

Answers

  • Hi siggymar,

    >> I register a list of TASKS in column A and use the next column B to define a STATUS for the various tasks.(Create a drop down list with predefined status values). If the value of a cell in column B (STATUS) is e.g. COMPLETED, I want that row of values to be transfered to the next sheet.

    In my option, you could loop column B, check the value of the cells, if value is COMPLETED, copy the entire row to another sheet which you want. Here is a simple demo.

    Sub RowCopy()
    '
    ' RowCopy Macro
    '
    
    '
    Dim c As range
    Dim objRange As range
    ‘loop the B11 to B12
    For Each c In Worksheets("Sheet6").range("B11:B12").Cells
    Sheets("Sheet6").Select
    ‘check the value of the cell
        If c.Value = "COMPLETED" Then
            c.EntireRow.Select
            ‘copy the row
            Selection.Copy
            Sheets("Sheet8").Select
            Set objRange = ActiveSheet.UsedRange
             ‘append the row to the sheet8
            Rows(objRange.Row + 1).EntireRow.PasteSpecial
        End If
    Next
    End Sub
    

    You will need to change it with your own requirement.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, September 7, 2015 2:58 AM