Return Index of an Element in an Array Excel VBA

后端 未结 7 1659
悲&欢浪女
悲&欢浪女 2020-11-29 20:42

I have an array prLst that is a list of integers. The integers are not sorted, because their position in the array represents a particular column on a spreadsheet. I want t

7条回答
  •  臣服心动
    2020-11-29 20:49

    The only (& even though cumbersome but yet expedient / relatively quick) way I can do this, is to concatenate the any-dimensional array, and reduce it to 1 dimension, with "/[column number]//\|" as the delimiter.

    & use a single-cell result multiple lookupall macro function on the this 1-d column.

    & then index match to pull out the positions. (usuing multiple find match)

    That way you get all matching occurrences of the element/string your looking for, in the original any-dimension array, and their positions. In one cell.

    Wish I could write a macro / function for this entire process. It would save me more fuss.

提交回复
热议问题