Copy row to another sheet if cell contains a 0

aiwnjoo

Well-known Member
Joined
Jul 30, 2009
Messages
598
Is there an easy way to automate if a cell in Column O for example contains a 0 then it highlights the entire row and pastes it into the next available row in another sheet lets call this Zeros.
Ive tried using the recorder but it gets funky.

Thanks,
 
SOLVED:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim LR As Long
    
    On Error Resume Next
    
    LR = Sheets("Zeros").Cells(Rows.Count, "A").End(xlUp).Row + 1
    
    If Not Intersect(Target, Columns("O")) Is Nothing Then
        If Target.Value = 0 Then
            Intersect(Target.EntireRow, Columns("A:V")).Copy
            
            Sheets("Zeros").Range("A" & LR).PasteSpecial xlValues
 
            Application.CutCopyMode = False
        End If
    End If
End Sub
 
Upvote 0

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,216,084
Messages
6,128,722
Members
449,465
Latest member
TAKLAM

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top