我写了一个VBA,但如果列中的单元格包含单词new,我希望它复制。例如;我有New,New-delete,New-add,new-available等等。所以我真的希望它能找到新的单词,无论是什么,然后复制。这就是我到目前为止所得到的,但它只是抓住我告诉它的任何价值。
Private Sub CommandButton2_Click()
a = Worksheets("Combined2").Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To a
If Worksheets("Combined2").Cells(i, 1).Value = "New delete" Then
Worksheets("Combined2").Rows(i).Copy
Worksheets("Running Data").Activate
b = Worksheets("Running Data").Cells(Rows.Count, 1).End(xlUp).Row
Worksheets("Running Data").Cells(b + 1, 1).Select
ActiveSheet.Paste
Worksheets("Combined2").Activate
End If
Next
Application.CutCopyMode = False
End Sub