Which is faster... or better programming

G

Guest

I was wondering which method people would recommend to do teh following.

There are two workbooks Old.xls and New.xls. I need to compare the
value/string in each cell in Column A in Old.xls with the cells in Column A
in New.xls. When matched then the value in Column I in Old.xls must be added
to the value in the corresponding row in Column I in New.xls

So...is it better to do row by row comparison and a single addition between
workbooks?

Or should I create an array from the Old.xls with just Column A and Column I
and then do the comparison and addition?

Or should I create ranges of Column A in the New.xls and do the comparison
with an Intersect function?

Or...?

There are always better ways to do things and I would like to see what
others have experienced.

thanks
 
N

Nigel

Not sure if it is the fastest but my approach would be to put ColA New and
ColA Old into an array, scan the array for differences and write a new colI
value where the same. I experience faster response than reading each row in
directly from the sheet.
 
B

Bob Phillips

Seconded.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top