Originally Posted by
FrothyD
Hi all, new to vba so this may be very simple and I'm just missing it.
In short, I'm working on a macro to check if a column in a worksheet (with a variable # of rows from day-to-day), contains one of five different text values. If it contains one of these values, then to copy the entire row to a new row on the specified page, and continue through the document.
The portion of code giving me trouble: -if you have a better/simpler solution, I am all ears
(the "If TargetValue = ..." row is giving me the errors, if that helps)
Sheets("Report").Select
TargetColumn = 6
If TargetValue = "James" Or "Mike" Or "C.H.I.C.O. Hard-Ware" Or "Rubik" Then
Target.EntireRow.Copy _
Destination:=Sheets("New Sheet").Range("A4" & nextRow)
End If
End Sub
Let me know what you think.
Thanks,
FrothyD
Something like this might help. But its hard to know without seeing the workbook.
or try Target.Value
Kaizor
Bookmarks