Hi,
i have an excel macro that does the following.
if the value in Column V = yes then it copies 2 cells from the same line to a different sheet.
what i want to add is the following:
if the value = yes then
if cell XXX (for exable B - from the same row) value = camera then it will copy the rows to sheet camera.
if it equals to =AC it will copy the cells to another sheet and so on.
this is what i have.
thanks
i have an excel macro that does the following.
if the value in Column V = yes then it copies 2 cells from the same line to a different sheet.
what i want to add is the following:
if the value = yes then
if cell XXX (for exable B - from the same row) value = camera then it will copy the rows to sheet camera.
if it equals to =AC it will copy the cells to another sheet and so on.
this is what i have.
Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Application.EnableEvents = True
If Target.Column <> 22 Then Exit Sub
If Target.Value = "Yes" Or Target.Value = "yes" Then
Cells(Target.Row, "E").Copy Destination:=Sheets("Cameras").Range("A" & Rows.Count).End(xlUp).Offset(1)
Cells(Target.Row, "V").Copy Destination:=Sheets("Cameras").Range("B" & Rows.Count).End(xlUp).Offset(1)
' End If
' If Cells(Target.Rows, "D") = Access Then
' Cells(Target.Row, "E").Copy Destination:=Sheets("ACS").Range("A" & Rows.Count).End(xlUp).Offset(1)
' Cells(Target.Row, "P").Copy Destination:=Sheets("ACS").Range("B" & Rows.Count).End(xlUp).Offset(1)
' End If
End If
If Target.Column <> 22 Then Exit Sub
If Target.Value = "No" Then
Cells(Target.Row, "E").Copy Destination:=Sheets("Cameras").Range("D" & Rows.Count).End(xlUp).Offset(1)
Cells(Target.Row, "V").Copy Destination:=Sheets("Cameras").Range("E" & Rows.Count).End(xlUp).Offset(1)
End If
End Sub
thanks