I think you may have screwed up again and once again given the wrong explanation….
… I think you mean…… Match Column I of sample1.xls with column B (Field 2) of sample2.csv
Field 2(column B) values in your Sample2.csv comma separated values text file:
NSE , 101010, 6, < , 12783, A , , , , , GTT NSE , 22, 6, < , 12783, A , , , , , GTT NSE , 17388, 6, < , 12783, A , , , , , GTT
Column I of Sample1.xls
Row\Col I 1 2 17388 3 100 4 15083 5 25 6 22 7
Here is your supplied text file, Sample2.csv:
https://excelfox.com/forum/showthrea...ll=1#post13475
Here is the corrected explanation that I use…
Either of these 2 conditions are to result in macro will copy value in column I of sample1.xls to field 2(column B) of text file Sample2.csv on a new line:
Condition 1) Only If column K of sample1.xls is greater than Column D of sample1.xls & Column H of sample1.xls is Greater than column K of sample1.xls then Match Column I of sample1.xls with second field values (column B) of sample2.csv & if it is there then do nothing & if it is not present then paste the column I data of sample1.xls to append second field values (column B) of sample2.csv
Condition 2) Only If column K of sample1.xls is lower than Column D of sample1.xls & Column H of sample1.xls is lower than column K of sample1.xls then Match Column I of sample1.xls with second field values (column B) of sample2.csv & if it is there then do nothing & if it is not present then paste the column I data of sample1.xls to append second field values (column B) of sample2.csv
OR
__ ( If column K of sample1.xls is greater than Column D of sample1.xls & Column H of sample1.xls is Greater than column K of sample1.xls ) or ( If column K of sample1.xls is lower than Column D of sample1.xls & Column H of sample1.xls is lower than column K of sample1.xls ) Then
____
Match Column I of sample1.xls with second field values (column B) of sample2.csv & if it is there then do nothing & if it is not present then paste the column I data of sample1.xls to append second field values (column B) of sample2.csv
Before:
_____ Workbook: Sample1.xls ( Using Excel 2007 32 bit )
Worksheet: Sample1 5June
Row\Col A B C D E F G H I J K 1Exchange Symbol Series/Expiry Open High Low Prev Close LTP 2NSE ACC EQ 1295.83 1310 1280.25 1270.2 1310 17388SHORT 1308.79 3NSE ADANIENT EQ 151.5 154.9 150 148.35 155 100SHORT 153.015 4NSE ADANIPORTS EQ 329.26 336.35 326 323.8 331 15083BUY 325.967 5NSE ADANIPOWER EQ 39.6 40 37.75 36.4 39 25SHORT 39.204 6NSE AMARAJABAT EQ 636.3 655.7 630 614.6 600 22SHORT 629.937
Sample2.csv
https://excelfox.com/forum/showthrea...ll=1#post13475
https://excelfox.com/forum/showthrea...ll=1#post13476
After: running macro here: https://excelfox.com/forum/showthrea...ll=1#post13478
Sample2After.csv
https://excelfox.com/forum/showthrea...ll=1#post13477
Sample2After.csv : https://app.box.com/s/0j4118cwzzofe76ytb5rqkvz3qj0vseu
NSE,101010,6,<,12783,A,,,,,GTT
NSE,22,6,<,12783,A,,,,,GTT
NSE,17388,6,<,12783,A,,,,,GTT
,100,,,,,,,,,,
,25,,,,,,,,,,
Alan
sample2.csv : https://app.box.com/s/0ej2h41g9fvm94cflf2j60a8o6p3334t
Sample1.xls : https://app.box.com/s/xh58fgjl74w06hvsd53jriqkohdm6a3q
macro.xlsm : https://app.box.com/s/z358r7tbc9hzthi539dlj49jsf4gyg8p
Sample2After.csv : https://app.box.com/s/0j4118cwzzofe76ytb5rqkvz3qj0vseu
vba.xlsm : https://app.box.com/s/juekenyll42z84j6ms7qonzsngnugoyo





Reply With Quote

Bookmarks