Is it possible to fill an array with row numbers which match a certain criteria without looping?

前端 未结 8 1790
陌清茗
陌清茗 2020-11-27 17:33

I would like to fill an array in VBA with the row numbers of only rows which meet a certain criteria. I would like the fastest method possible (for example, something like <

8条回答
  •  离开以前
    2020-11-27 18:15

    First copy the range to a variant array , then loop over the array

    Arr = rngval
    For I = 1 to ubound(arr)
        If arr(I,1) = valMatch Then RowArray(x) = I: x = x + 1
    Next
    

提交回复
热议问题