Hi Thai,
So I move on now …..
The purpose of this post is to walk through extending the columns in the comparison
Some other notes:
***_1 The final output format my not be as you wish. It is better at this stage to check that the correct results are obtained. We can modify easy later the actual result output format
_2 I suggest delaying any code additions to make a pop up message box until we are further as this is relatively easy to do but it would need to be modified at each code development stage. So best not waste that time and just do the job once , when we are further towards the end of the project.
_._________________________________
How to extension compare between data
Two main modifications:.
_1 We need to capture enough data: So we need to capture to include B , C , E , F , G
Conveniently in coding we will capture B-G. ( So We will also have D in the captured data, but we will not use that )
For example code modification:
arrSht1() = Ws1.Range("A1:B" & Lr1 & "").Value
change to
arrSht1() = Ws1.Range("B1:G" & Lr1 & "").Value
So now, our captured data is a 6 “column” array looking like this:
6 Column captured array.JPG : https://imgur.com/8UN2Q7a
6 Column captured array.jpg
_2 Instead of check data A & B we now need B & C & E & F & G
For example code modification
arrSht1Chk(Cnt) = arrSht1(Cnt, 1) & "|" & arrSht1(Cnt, 2)
change to
arrSht1Chk(Cnt) = arrSht1(Cnt, 1) & "|" & arrSht1(Cnt, 2) & "|" & arrSht1(Cnt, 4) & "|" & arrSht1(Cnt, 5) & "|" & arrSht1(Cnt, 6)
( Note the “|” is just for my convenience so that I can see easier the data, as I showed you before https://imgur.com/8tw5L61 , http://www.excelfox.com/forum/showth...tabs#post10744 )
But now we see we are looking at 5 columns ,
1 2 _ 4 5 6 corresponding to B & C _ & _ E & F & G:
5 Column extended cocatenated String comparison data.JPG : https://imgur.com/ZQ6hsIA
5 Column extended cocatenated String comparison data.JPG
***Other modifications I have done concern the test Output. These we will probably want to change later for the specific output format we require. I have already explained to you some of the ways to modify the actual results format. As I mentioned previously, at this testing stage, the exact results format is not so important
So new code at this stage is here:
http://www.excelfox.com/forum/showth...0752#post10752
Here are some test results:
http://www.excelfox.com/forum/showth...0751#post10751
( note a typo in your data for row 9 : Angle is not Angel . hence this is taken by my code as Missing data row )
_._____________________
Report back to me and we will take the project further. Important at this stage is to get the actual result info correct. ( see Note below ) The exact format can be done later***.
Alan
_.____________________________________-
P.S.
Note:
Note one extra point you may need to consider
Take the scenario of two things happening at the same time
_ that on sheet2 ( NEW ) there is new data on say, row 3
_ the data from row 3 on sheet1 ( Original) is not anywhere in sheet2 ( NEW )
In my current coding this scenario will result in the Missing data being indicated in the corresponding for row 3 in the output results. In such a scenario, the new data in row 3 on sheet2 ( NEW ) will not be indicated.
You must think about this and decide what info you want displayed on the output ( the missing or new data ) , or both. Possibly you have not thought of this scenario?




Reply With Quote

Bookmarks