Hi bmuum3
Not trying to solve you problem because NickyC did that.
I’m just curious about your range selection i.e. “A2:A40000”.
If you are setting it that big just to be sure you “capture” all values you could instead try to set the range dynamically.
Range(“A2:A” & Range(“A” & Rows.Count).End(xlUp).Row) will go from the bottom and upwards to the first value in the A column. If the first value found is at row 1500 (going from the bottom and upwards) excel will then interpret
Range(“A2:A” & Range(“A” & Rows.Count).End(xlUp).Row) as Range(“A2:A1500”)
So you could rewrite your macro a bit changing
to
Alf
Ps Always wrap your code or the moderators will be upset!
Bookmarks