Please bear with me as I am definitely not an EXCEL or VBA guru, and I do not know if this has been previously described in the forum.
I have a workbook where I am trying to compare 2 excel files to show that they are the same.
The file is extracted from a database as a CSV to a secure location - (Original data) and then copied to a 2nd location for use - (Moved Data)
To do this I have a front tab (Tab1) where I have a report that provides a whole load of information from the name of the files being compared and their location and hope to report the number of differences
Tab 2 is the location where file 1 is imported to (Original data)
Tab 3 is where file 2 is imported to (Moved Data)
Tab 4 is where I compare each cell using the following formula:
=IF('Original data'!A1="","",IF('Original data'!A1='Moved Data'!A1,"Y","N"))
the above formula is repeated for every cell for approximately 800 columns and 6000 rows comparing. This makes loading the workbook very time consuming but more importantly may not capture al the imported data if the data goes beyond the pre-set range.
Can some one please show me how to:
1) in VBA reference the maximum Column no which I report in say Tab 1 Cell C20 lets say this is Ix and the same for the maximum Row again in Tab1 Cell 21 and call it Jx
2) make a loop coding to place an appropriate formula (for that above) to be placed in each cell in tab 4 so that every cell form A1 to (Jx,Ix) is covered (this way every cell in the original data file tab (tab 2) will be compared to that in Tab 3 and the outcome displayed in tab 4
e.g.
Tab 1 cell C20 = 5 (the maximum no of columns used in tab 2)
cell C21= 4 (the maximum no of rows used in tab 2)
Tab2 : contents
(row/column) a b c d e
1 ABC 1 3 4 A
2 BCD 1 2 4 F
3 CDE 2 3 4 X
4 FGH 4 3 4 B
Tab3 : Contents
(row/column) a b c d e
1 ABC 1 3 4 ?
2 BCD 1 2 4 F
3 CDE 2 3 4 X
4 FGH 4 9 4 B
Tab 4 should fill with the formula from A1 to E4 such that it will compare each cell and report an "N" for cell E1 and C4 as both these are different in tab 3 to tab 2
any help would be appreciated
I have a workbook where I am trying to compare 2 excel files to show that they are the same.
The file is extracted from a database as a CSV to a secure location - (Original data) and then copied to a 2nd location for use - (Moved Data)
To do this I have a front tab (Tab1) where I have a report that provides a whole load of information from the name of the files being compared and their location and hope to report the number of differences
Tab 2 is the location where file 1 is imported to (Original data)
Tab 3 is where file 2 is imported to (Moved Data)
Tab 4 is where I compare each cell using the following formula:
=IF('Original data'!A1="","",IF('Original data'!A1='Moved Data'!A1,"Y","N"))
the above formula is repeated for every cell for approximately 800 columns and 6000 rows comparing. This makes loading the workbook very time consuming but more importantly may not capture al the imported data if the data goes beyond the pre-set range.
Can some one please show me how to:
1) in VBA reference the maximum Column no which I report in say Tab 1 Cell C20 lets say this is Ix and the same for the maximum Row again in Tab1 Cell 21 and call it Jx
2) make a loop coding to place an appropriate formula (for that above) to be placed in each cell in tab 4 so that every cell form A1 to (Jx,Ix) is covered (this way every cell in the original data file tab (tab 2) will be compared to that in Tab 3 and the outcome displayed in tab 4
e.g.
Tab 1 cell C20 = 5 (the maximum no of columns used in tab 2)
cell C21= 4 (the maximum no of rows used in tab 2)
Tab2 : contents
(row/column) a b c d e
1 ABC 1 3 4 A
2 BCD 1 2 4 F
3 CDE 2 3 4 X
4 FGH 4 3 4 B
Tab3 : Contents
(row/column) a b c d e
1 ABC 1 3 4 ?
2 BCD 1 2 4 F
3 CDE 2 3 4 X
4 FGH 4 9 4 B
Tab 4 should fill with the formula from A1 to E4 such that it will compare each cell and report an "N" for cell E1 and C4 as both these are different in tab 3 to tab 2
any help would be appreciated