[英]Copy if part of the text cell found excel VBA
With Worksheets("Sheet1")
For each cel in .Range(.Range("B1"),.Range("B1").End(xlDown))
If cel.Value Like "*FAA*" Then
Worksheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1).Value = cel.Offset(,1).Value
cel.Resize(1,2).ClearContents
End If
Next
'if you wish to remove the rows entirely use this code, if not comment out
.Range(.Range("B1"),.Range("A1").End(xlDown).Offset(,1)).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End With
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.