Results 1 to 1 of 1

Thread: Copy & Paste Entire row if condition Matches

  1. #1
    Seeker letmein's Avatar
    Join Date
    Jan 2017
    Location
    london
    Posts
    7
    Articles
    0
    Excel Version
    2013

    Copy & Paste Entire row if condition Matches



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hello Guys,
    I am looking for a macro that will conditionally copy & paste the data
    I have a file macro.xlsm & vba macro will be placed in a macro.xlsm & i have one more file sample1.xls (both files are located in different path & the path should be hardcoded in the macro, so that i can change it as per my needs )


    We have to copy the data if condition matches. If column B of sample1.xls (sheet1) match with column B of sheet3 of macro.xlsm then compare Column E of sample1.xls(sheet1) with column E of macro.xlsm (sheet3) & If they are different then copy that row from sheet1 of sample1.xls & paste the data to macro.xlsm sheet2
    Or
    If Column F of sample1.xls(sheet1) differs with column F of macro.xlsm (sheet3) then copy that row of sample1.xls sheet1 and paste it to macro.xlsm (sheet2)






    Note: There is a chance of a blank sheet ( may be sample1.xls has a blank sheet1 Or Macro.xlsm sheet3 may be a blank sheet Or Sheet2 of Macro.xlsm may be a blank sheet Or it may have a data)
    There is a chance that macro.xlsm may have the same data already which is there in sample1.xls then in that case do not compare that row of sample1.xls sheet1 with macro.xlsm sheet3
    Plz see the OutPut sheet


    Thnx
    Attached Files Attached Files

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
  •