sub find()
dim i as long, x as string, y as long, Sheet1rows as long
x = "ra01"
y = 2
Sheet1rows = Sheets("Sheet1").UsedRange.Rows.Count + 1
For i = y To Sheet1rows
If InStr(1, Sheets("Sheet1").Cells(i, 3), x) > 0 Then
Sheets("Sheet3").Range("F" & y) = Sheets("Sheet1").Cells(i, 6)
y = y + 1
End If
Next i
end sub
答案 0 :(得分:0)
试试这个...
For i = y To Sheet1rows
If InStr(1, Sheets("Sheet1").Cells(i, 3), x) > 0 Then
Sheets("Sheet3").Range("F" & y) = Sheets("Sheet1").Cells(i, 6)
y = y + 1
End If
Next