Will from London
Board Regular
- Joined
- Oct 14, 2004
- Messages
- 220
Hi,
Part of what I'm trying to do involves comparing the data in two tables at different time periods. What I would like to do is produce a worksheet that shows a third table with the differences. I imagine that the best solution would be a macro which makes use of two dimensional arrays but I'm not all that sure how to use two dimensional ones! If my inputs were:
Table 1:
Name,Weight,Height,Hair
Anne,9,5,Brown
Bob,13,6,Black
Charlie,11,5,Blond
Table 2:
Name,Weight,Height,Hair
Anne,9,6,Green
Bob,13,6,Black
Charlie,11,7,Blond
Output would be a table:
Name,Height,Hair
Anne,From 5 to 6, From Brown to Green
Charlie,From 5 to 7,
The bottom right cell would be blank becaue the data for Charlie's hair has not altered.
The above example was for illustration; the actual data and tables have the following characteristics:
1. Always comma delimited.
2. First row contains column headers.
3. First column contains row headers.
4. Neither will necessarily be sorted alphabetically.
5. Rows and /or columns may be added/deleted between a time period. If rows or columns have been added or deleted the whole new or deleted row or column should be shown and marked as such in the output. One of the impacts of this is that the number of rows and columns may differ between the two tables.
Any suggestions would be much appreciated,
Will
Part of what I'm trying to do involves comparing the data in two tables at different time periods. What I would like to do is produce a worksheet that shows a third table with the differences. I imagine that the best solution would be a macro which makes use of two dimensional arrays but I'm not all that sure how to use two dimensional ones! If my inputs were:
Table 1:
Name,Weight,Height,Hair
Anne,9,5,Brown
Bob,13,6,Black
Charlie,11,5,Blond
Table 2:
Name,Weight,Height,Hair
Anne,9,6,Green
Bob,13,6,Black
Charlie,11,7,Blond
Output would be a table:
Name,Height,Hair
Anne,From 5 to 6, From Brown to Green
Charlie,From 5 to 7,
The bottom right cell would be blank becaue the data for Charlie's hair has not altered.
The above example was for illustration; the actual data and tables have the following characteristics:
1. Always comma delimited.
2. First row contains column headers.
3. First column contains row headers.
4. Neither will necessarily be sorted alphabetically.
5. Rows and /or columns may be added/deleted between a time period. If rows or columns have been added or deleted the whole new or deleted row or column should be shown and marked as such in the output. One of the impacts of this is that the number of rows and columns may differ between the two tables.
Any suggestions would be much appreciated,
Will