Hi guys and girls,
I have a some data stored in a variant that I loop through like this:
What I'm trying to do is to find if there's a duplicate in a column and if so, locate the row with the duplicate.![]()
For x = lbound(row) to ubound(row) ... ... do something with row(x) ... Next x
Finding if there's a duplicate is easy like this:
but my challenge is finding the row.![]()
If Application.CountIf(fs.Columns(3), row(x)) > 0 Then
If I use application Match, it will error because the countif will count regardless of format, but match won't.
So if there's a number or currency in row(x) - in the variable it's not stored as number or currency, but in the cell it is, so match won't find anything and my code will error.
So I thought to use find instead, but the problem I encounter with find is that it excludes the first fow - so if the duplicate is in C1, it'll return the row with the next duplicate.![]()
rw = Application.Match(rows(x), fs.columns(3), 0)
So, what's the bright idea that stupid me didn't think of to solve this?![]()
rw = fs.Columns(3).Find(what:=row(x), LookAt:=xlwhole).row![]()











LinkBack URL
About LinkBacks
Register To Reply
Bookmarks