![]() |
Arrays: compare fields?
Hello,
I have a problem that I just cannot solve myself. Please, if you have knowledge that can get me on track, post a comment. Here it goes.. I have two sheets, with rather big amounts of data. They consist of imported txt-files, and can vary in row-size (the columns are fixed and always the same) After my last import, sheet one consist of roughly 5000 rows, and sheet two of roughly 2000 rows. They both consist of 26 columns. The columns consist of various data types; text, integers, percent values, dates etc. What I want to do is to compare the tables based on the value in the leftmost columns in both tables (these are project-numbers in both tables) and store the matching data on the same rows on a third sheet (this will then have 52 columns). First, I did this by looping, but this takes way to much time, so I want to read both tables into two-dimensional arrays, and either build the matched rows into a third array and write this third array into sheet 3 (or alternatively, write the matched rows directly to sheet 3). I cannot get this to work. It finishes, but the matches are incorrect. Hope to get some replies; I have a deadline on this tomorrow - UGH! Best regards NorTor |
Arrays: compare fields?
NorTor.
Check out Chip Pearson's page. Should give you a start in Excel or VBA. http://www.cpearson.com/excel/duplicat.htm NickHK "NorTor" wrote in message ... Hello, I have a problem that I just cannot solve myself. Please, if you have knowledge that can get me on track, post a comment. Here it goes.. I have two sheets, with rather big amounts of data. They consist of imported txt-files, and can vary in row-size (the columns are fixed and always the same) After my last import, sheet one consist of roughly 5000 rows, and sheet two of roughly 2000 rows. They both consist of 26 columns. The columns consist of various data types; text, integers, percent values, dates etc. What I want to do is to compare the tables based on the value in the leftmost columns in both tables (these are project-numbers in both tables) and store the matching data on the same rows on a third sheet (this will then have 52 columns). First, I did this by looping, but this takes way to much time, so I want to read both tables into two-dimensional arrays, and either build the matched rows into a third array and write this third array into sheet 3 (or alternatively, write the matched rows directly to sheet 3). I cannot get this to work. It finishes, but the matches are incorrect. Hope to get some replies; I have a deadline on this tomorrow - UGH! Best regards NorTor |
All times are GMT +1. The time now is 07:32 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com