|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 lsc900707 于 2016-12-26 07:41 编辑
Sub lsc()
Dim i, j, arr, brr
Sheets("Sheet2").Cells.Clear
arr = Sheets("数据源").UsedRange
ReDim brr(1 To UBound(arr), 1 To UBound(arr, 2))
For i = 1 To UBound(arr)
If (arr(i, 1) = "A01" Or arr(i, 1) = "A04" Or arr(i, 1) = "A05") And _
(arr(i, 2) = "A" Or arr(i, 2) = "B" Or arr(i, 2) = "C") Then
j = j + 1
brr(j, 1) = arr(i, 1): brr(j, 2) = arr(i, 2)
End If
Next
Sheets("Sheet2").[a2].Resize(j, 2) = brr
MsgBox "ok"
End Su |
|