Gabrielle9
New Member
- Joined
- Jan 25, 2023
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
Hi! I want to use vba dictionary method because i have over 200k rows which takes a lot of time to run. I found that using dictionary method would be faster than Worksheet countif function, but i could not find somethig to convert my formula to something that will return each appearence of the duplicate value
My excel formula:
=If(countif($N$2:$B$200122,N2)>1,"Duplicate value", " ")
=If(countif($N$2:$B$200122,N3)>1,"Duplicate value", " ")
..............
If(countif($N$2:$B$200122,N200122)>1,"Duplicate value", " ")
Vba code:
Lastrow= cells(rows.count,2).end(xlUp).row
For n=2 to lastrow
If application.countif(range("N2:N") & last row), Range ("N" & n)) > 1 then
Range("O" & n).Value = true
Else
My excel formula:
=If(countif($N$2:$B$200122,N2)>1,"Duplicate value", " ")
=If(countif($N$2:$B$200122,N3)>1,"Duplicate value", " ")
..............
If(countif($N$2:$B$200122,N200122)>1,"Duplicate value", " ")
Vba code:
Lastrow= cells(rows.count,2).end(xlUp).row
For n=2 to lastrow
If application.countif(range("N2:N") & last row), Range ("N" & n)) > 1 then
Range("O" & n).Value = true
Else