Finding every instance of a value in a multi-sheet workbook

  • Thread starter Maury Markowitz
  • Start date
M

Maury Markowitz

I need to find every occurrence of a unique ID in a multi-sheet
workbook.

I have already implemented this in code simply by looping over the
sheets, finding the column (it can potentially move from sheet to
sheet, but doesn't yet), and then looping over that column to find the
row numbers and put them in an array.

But now I'm thinking that this might not be the best way to do this,
and some sort of Find would be more efficient. I've never seen
anything like this though, a variation of Find that returns a single
"something" with all of the hits in it.

Any ideas?

Maury
 
D

Dave Peterson

How about this suggestion??

If you have to have your own code, look at .findnext in VBA's help.
 
M

Maury Markowitz

How about this suggestion??

If you have to have your own code, look at .findnext in VBA's help.

I did. However, MS, in their infinite wisdom, decided that .FindNext
will not look in hidden cells. The cells I'm looking for are, of
course, hidden. FindNext has all sorts of other problems too, I find
it to be generally unstable in terms of predictable behavior.

BTW, a text editor demonstrated that FlexFind also uses Find/FindNext.

Maury
 
D

Dave Peterson

You can either unhide all the columns/rows or you can loop through the usedrange
of each sheet.

I don't think that there's any middle ground.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top