Results 1 to 10 of 86

Thread: Copy Paste based on comparisons calculations in 2 XL files, 1 might be .csv file .Opened in XL=Fail/Chaos

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    I think you may have screwed up again and once again given the wrong explanation….
    Quote Originally Posted by fixer View Post
    ... 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 B of sample1.xls with column B of sample2.csv....
    … 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 )
    Row\Col
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    1
    Exchange Symbol Series/Expiry Open High Low Prev Close LTP
    2
    NSE ACC EQ
    1295.83
    1310
    1280.25
    1270.2
    1310
    17388
    SHORT
    1308.79
    3
    NSE ADANIENT EQ
    151.5
    154.9
    150
    148.35
    155
    100
    SHORT
    153.015
    4
    NSE ADANIPORTS EQ
    329.26
    336.35
    326
    323.8
    331
    15083
    BUY
    325.967
    5
    NSE ADANIPOWER EQ
    39.6
    40
    37.75
    36.4
    39
    25
    SHORT
    39.204
    6
    NSE AMARAJABAT EQ
    636.3
    655.7
    630
    614.6
    600
    22
    SHORT
    629.937
    Worksheet: Sample1 5June

    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
    Last edited by DocAElstein; 06-07-2020 at 03:59 AM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    KILL A MODERATOR!!

Similar Threads

  1. Replies: 26
    Last Post: 09-26-2020, 05:56 PM
  2. Copy paste data based on criteria
    By analyst in forum Excel Help
    Replies: 7
    Last Post: 01-13-2014, 12:46 PM
  3. Replies: 8
    Last Post: 10-31-2013, 12:38 AM
  4. Replies: 2
    Last Post: 09-18-2013, 12:30 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •