vba - Range.Find in loop crashes for 50K rows in Excel -


i have huge list of numbers search in excel. column contains 358 k rows , column b contains 55 k rows , need 3 results 1. matching in & b 2. number present in not in b 3. number present in b not in a

excel version 2013. if use formula, crashes. if use vba, range.find, crashes few times, completes. takes huge amount of time complete. here code. not sure if there other way achieve same result.

    application.enableevents = false      application.screenupdating = false      application.calculation = xlcalculationmanual           set objngupcrange = activesheet.range("b3:b55533")      lcellend = 3      ldcellend1 = 3      ldcellend2 = 3            while range("a" & lcellend).value <> ""          set objngupcsearch = objngupcrange.find(what:=range("a" & lcellend).value, lookat:=xlwhole)                    if objngupcsearch nothing              range("e" & ldcellend1).value = range("a" & lcellend).value 'present in not in b              ldcellend1 = ldcellend1 + 1          else              range("f" & ldcellend2).value = range("a" & lcellend).value 'matching in & b              ldcellend2 = ldcellend2 + 1          end if    	set objngupcsearch = nothing                lcellend = lcellend + 1      wend            lcellend = 3      ldcellend1 = 3        set objngupcrange = activesheet.range("a3:a358227")            while range("b" & lcellend).value <> ""          set objngupcsearch = objngupcrange.find(what:=range("b" & lcellend).value, lookat:=xlwhole)                    if objngupcrange nothing              range("g" & ldcellend1).value = range("b" & lcellend).value 'present in b not in              ldcellend1 = ldcellend1 + 1          end if    	set objngupcsearch = nothing                lcellend = lcellend + 1                wend            application.enableevents = true      application.screenupdating = true      application.calculation = xlcalculationautomatic

any appreciated.

~muru


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -