Auto copy data from sheet1 to sheet based on criteria [Solved]

Report
-
Posts
2745
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
May 17, 2021
-
Hello,

I am trying to auto copy values from Sheet1, Col A to Sheet 2 only if criteria from Sheet1, Col b is met. I have tried so many different types of code both in VBA and an IF statement and I cant get it to work. Any help is much appreciated.

System Configuration: Windows / Chrome 89.0.4389.90

1 reply

Posts
2745
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
May 17, 2021
461
Hi Willis,

You mean like this?:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Columns("A")) Is Nothing Then Exit Sub
If Target.Cells.Count > 1 Then Exit Sub

If Target.Offset(0, 1).Value = "Criteria" Then
    Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Value = Target.Value
End If
End Sub


Best regards,
Trowa

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!