Hello everyone!
So what I need my macro to do is search through a sheet, find a value, and copy cells in Column A and Column C and paste them into a new sheet. This code works fine except for the copy part. I can make it copy the whole row but not the invidividual Cells in A or C. Any help is appreciated!
So what I need my macro to do is search through a sheet, find a value, and copy cells in Column A and Column C and paste them into a new sheet. This code works fine except for the copy part. I can make it copy the whole row but not the invidividual Cells in A or C. Any help is appreciated!
Code:
Public Sub Copy()
Sheets("Sheet1").Select
FinalRow = Range("A10").End(xlUp).Row
For x = 2 To FinalRow
ThisValue = Range("C" & x).Value
If ThisValue = "AA" Then
Range("A" & x).Copy
Sheets("Sheet2").Select
NextRow = Range("A10").End(xlUp).Row + 1
Range("A" & NextRow).Select
ActiveSheet.Paste
Sheets("Sheet1").Select
ElseIf ThisValue = "B" Then
Range("A" & x & ":AG" & x).Copy
Sheets("Sheet2").Select
NextRow = Range("A10").End(xlUp).Row + 1
Range("A" & NextRow).Select
ActiveSheet.Paste
Sheets("Sheet1").Select
End If
Next x
End Sub