Am trying to copy an entire row from Sheet1 (FA) to Sheet 2 (FABREAK), if the cells in Column A contains the word NPC. I have the following code:
Sub CopyRows()
Dim bottomL As Integer
Dim x As Integer
bottomL = Sheets("FA").Range("A" & Rows.Count).End(xlUp).Row: x = 1
Dim c As Range
For Each c In Sheets("FA").Range("A1:L" & bottomL)
If c.Value = "NPC" Then
c.EntireRow.Copy Worksheets("FABREAK").Range("A" & x)
x = x + 1
End If
Next c
End Sub
It works when Column A in Sheet FA has just the word "NPC" in it but fails when it contains "FA NPC". Is there a way to go around this problem? Am kinda new to Excel VBA. Any help would be good.