Results 1 to 10 of 49

Thread: Copy and Paste based on comparisons/Match and calculations of cells in two workbooks

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Senior Member
    Join Date
    Jul 2019
    Posts
    382
    Rep Power
    0

    copy and paste of data if matches

    I am looking for a macro that will do the process mentioned below
    If column I of 1.xls matches with sheet4 of column B of Alertcodes.xlsx & sheet4 of column D of Alertcodes.xlsx contains this symbol > then put SHORT in column J of 1.xls
    If column I of 1.xls matches with sheet4 of column B of Alertcodes.xlsx & sheet4 of column D of Alertcodes.xlsx contains this symbol < then put BUY in column J of 1.xls
    Plz Note
    All files are located in a different path (So in the macro the path will be hardcoded, Assume any path & I will edit the path manually by myself)
    Sheet name can be anything
    Macro will be putted in a vba.xlsm
    So plz have a look & take ur time
    Thnx For ur Great Help
    Attached Files Attached Files

  2. #2
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    Where are your “After” ???
    You have not given me after results to check against… Remember to do that always please.
    So if the results are not exactly what you want , then you will have to modify the macro yourself.. I can only go by your description / explanation. ( Often your explanations are in error - your discriptions often have mistakes in them, so a before and after is important)..




    If column I of 1.xls matches with sheet4 of column B of Alertcodes.xlsx & sheet4 of column D of Alertcodes.xlsx contains this symbol > then put SHORT in column J of 1.xls
    If column I of 1.xls matches with sheet4 of column B of Alertcodes.xlsx & sheet4 of column D of Alertcodes.xlsx contains this symbol < then put BUY in column J of 1.xls


    Or
    __ If column I of 1.xls matches with sheet4 of column B of Alertcodes.xlsx Then..
    ___ look at symbol in column D, 4th worksheet of AlertCodes.xlsx for that matched row in column D, 4th worksheet of AlertCodes.xlsx
    ____ If symbol is > then put SHORT in column J of 1.xls for the matched row
    ____ If symbol < then put BUY in column J of 1.xls for the matched row


    Before:

    _____ Workbook: AlertCodes.xlsx ( Using Excel 2007 32 bit )
    Row\Col A B C D E F G H I J K L
    1 NSE
    1270
    6
    <
    12536
    A GTT
    2 NSE
    22
    6
    >
    1517
    A GTT
    3 NSE
    25
    6
    <
    34425
    A GTT
    4 NSE
    15083
    6
    >
    3855
    A GTT
    5 NSE
    17388
    6
    <
    6531
    A GTT
    6 NSE
    100
    6
    <
    164875
    A GTT
    7 NSE
    236
    6
    <
    164875
    A GTT
    8
    Worksheet: Sheet4

    _____ Workbook: 1.xls ( Using Excel 2007 32 bit )
    Row\Col A B C D E F G H I J
    1 Exchange Symbol Series/Expiry Open High Low Prev Close LTP
    2 NSE ACC EQ
    1295.83
    1310
    1280.25
    1270.2
    1288
    22
    3 NSE ADANIENT EQ
    151.5
    154.9
    150
    148.35
    151.4
    25
    4 NSE ADANIPORTS EQ
    329.26
    336.35
    326
    323.8
    331
    15083
    5 NSE ADANIPOWER EQ
    39.6
    40
    37.75
    36.4
    39.3
    17388
    6 NSE AMARAJABAT EQ
    636.3
    655.7
    630
    614.6
    655.2
    100
    7 NSE ASIANPAINT EQ
    1689.435
    1711.9
    1681.5
    1683.1
    1694.75
    236
    8 NSE AMBUJACEM EQ
    189.882
    195.65
    189.4
    191.55
    189.7
    1270
    9
    Worksheet: 1-Sheet1 (2)


    After running macro here: https://excelfox.com/forum/showthrea...ll=1#post13732

    _____ Workbook: 1.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
    1288
    22
    SHORT
    3 NSE ADANIENT EQ
    151.5
    154.9
    150
    148.35
    151.4
    25
    BUY
    4 NSE ADANIPORTS EQ
    329.26
    336.35
    326
    323.8
    331
    15083
    SHORT
    5 NSE ADANIPOWER EQ
    39.6
    40
    37.75
    36.4
    39.3
    17388
    BUY
    6 NSE AMARAJABAT EQ
    636.3
    655.7
    630
    614.6
    655.2
    100
    BUY
    7 NSE ASIANPAINT EQ
    1689.435
    1711.9
    1681.5
    1683.1
    1694.75
    236
    BUY
    8 NSE AMBUJACEM EQ
    189.882
    195.65
    189.4
    191.55
    189.7
    1270
    BUY
    9
    Worksheet: 1-Sheet1 (2)



    Alan





    AlertCodes.xlsx : https://app.box.com/s/jwpjjut9wt3ej7dbns3269ftlpdr7xsm
    1.xls : https://app.box.com/s/38aoip5xi7018y9syt0xe4g04u95l6xk
    Vba.xlsm : https://app.box.com/s/lf6otsrl42m6vxxvycjo04zidya6pd2m
    Last edited by DocAElstein; 06-16-2020 at 01:26 PM.
    ….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: 85
    Last Post: 06-09-2020, 05:58 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: 4
    Last Post: 12-12-2013, 06:16 PM
  4. Replies: 8
    Last Post: 10-31-2013, 12:38 AM
  5. Replies: 2
    Last Post: 02-11-2013, 08:13 PM

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
  •