Sub 条件筛选显示()

Dim h, i, j, k, l, arr()

arr = Sheet2.Range("a1").CurrentRegion.Value '数组为a1开始的连续区域

i = Sheet2.Range("m1").Value '条件1单元格值
j = Sheet2.Range("n1").Value '条件2单元格值

For h = 2 To UBound(arr, 1)
    If arr(h, 1) = i And arr(h, 3) = j Then
    k = k + 1
        For l = 1 To 7       '7列数值
            arr(k, l) = arr(h, l)
        Next
    End If
Next
   
    Sheet2.Range("m3").Resize(k, 7) = arr '筛选显示区域


End Sub
如果觉得我的文章对你有用,请随意赞赏