Results 1 to 3 of 3

Thread: [RESOLVED] Copy & Paste if condition met with add & subtract

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2020
    Posts
    24

    Resolved [RESOLVED] Copy & Paste if condition met with add & subtract

    Hi Experts,
    I am looking for a macro that will do the things mentioned below

    there are 3 files 1.xls & BasketOrder.xlsx & macro.xlsm (macro will be placed in macro.xlsm),both files are loacted in diffrent places so the path will be hardcoded in the macro so that i can change it as per my needs
    sheet name can be anything
    plz see the sample file


    If column C of basketorder.xlsx matches with column B of 1.xls & Column J is BUY then add 0.05 to column D of 1.xls & compare column L of basketorder.xlsx with column D of of 1.xls & if column D of 1.xls is lower then Column L of basketorder.xlsx then replace column L data with column D data OF 1.xls

    If column C of basketorder.xlsx matches with column B of 1.xls & Column J is SELL then subtract 0.05 to column D of 1.xls & compare column L of basketorder.xlsx with column D of of 1.xls & if column D of 1.xls is greater then Column L of basketorder.xlsx then replace column L data with column D data OF 1.xls


    Thnx for the Help



    https://drive.google.com/file/d/1bEO...ew?usp=sharing
    https://drive.google.com/file/d/1MlF...ew?usp=sharing

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Copy & Paste if condition met with add & subtract

    have you tried doing any of this yourself?
    in these forums wee try to help people with code they are having problems with, we are not a free code writing service
    you have had several examples of code to do similar to what you are asking at least attempt to convert some of it to this task

    if you expect other to download your sample workbooks then post them here, zip first
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2020
    Posts
    24

    Re: [RESOLVED] Copy & Paste if condition met with add & subtract

    Problem Solved

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
  •  



Click Here to Expand Forum to Full Width