I need a code so that it reads a certain cell ( Cell A2 in this case) and if it matches the right name ( a in this example) it will copy specific cells and paste them into the last line in a column. Currently I cannot get it to paste. Are my notations incorrect and can somebody help me get this working? Thanks so much guys.
VBA Code:
Sub Test()
Dim N As Long
N = Sheet2.Cells(Rows.Count, "A").End(xlUp).Row + 1
If Sheet1.Range("A2") = a Then
Sheet2.Cells(N, A) = Sheet1.Range("B2")
Sheet2.Cells(N, A) = Sheet1.Range("C2")
End If
Else
End If
End Sub