Monday 15 September 2014

excel vba - how to copy matching number or non matching number in VBA -



excel vba - how to copy matching number or non matching number in VBA -

how find matching or non matching numbers between 2 sheets , re-create matching numbers sheet3 column , b non matching numbers. here code how it's not working.

= 1 lastrow ii = 1 xlastrow if worksheets("sheet1").cells(i,1) = worksheets("sheet2").cells(ii, 1) worksheets("sheet3").range("a" & x) = worksheets("sheet1").cells(i, 1) x = x + 1 elseif worksheets("sheet1").cells(i,1) <> worksheets("sheet2").cells(ii, 1) worksheets("sheet3").range("b" & x) = worksheets("sheet1").cells(i, 1) x = x + 1 next ii next

i'm not surprised excel not responding.

if understand correctly, you're running nested loop 4000 5000 iterations each, 25,000,000 iterations up, during reference multiple spreadsheet cell values.

it whatever trying (which not exclusively clear) done improve worksheet functions vlookup.

if must utilize nested loops, 1 thing speed lot read values array first , loop on array rather spreadsheet cells directly.

vba excel-vba

No comments:

Post a Comment