如果A列中的单元格包含单词NPC,则尝试将整行从Sheet1(FA)复制到Sheet 2(FABREAK)。我有以下代码:
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
当工作表FA中的A列只有单词" NPC"在它中但是当它包含" FA NPC"时失败。有办法解决这个问题吗?我是Excel VBA的新手。任何帮助都会很好。