+ Reply to Thread
Results 1 to 3 of 3

Conditionally copy & paste the data with matching

  1. #1
    Forum Contributor
    Join Date
    07-28-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    173

    Conditionally copy & paste the data with matching

    Hi,
    I am looking for a Vba Macro
    Conditions:
    Hardcode the Path of the file so that i can change it as per my needs

    macro will be placed in master.xlsm
    I have two files named as 1.xls & 2.xls
    i am looking for a macro that will match column A each cell data of 2.xls with column A each cell data of 1.xls & if it matches then it will copy column C data of 2.xls & column D data of 2.xls in & paste it to column D & column E of 1.xls
    & if it doesn't matches then do nothing

    Plz see the output sheet in 1.xls only for reference(there will be no output sheet in 1.xls , I have only created output sheeet only for understanding purpose)

    Thnx For The Great Help
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    11-04-2018
    Location
    Denpasar
    MS-Off Ver
    Excel 2010
    Posts
    777

    Re: Conditionally copy & paste the data with matching

    If I understand you correctly, maybe :
    Please Login or Register  to view this content.
    To test the sub :
    Copy your 1.xls and 2.xls to a test folder. For example in drive D:\test
    Create new workbook, name it Macro.xlsm then put the sub above in VBA module.

    In your Macro.xlsm active sheet, fill:
    cell A2 with D:\test\
    cell B2 with 1.xls
    cell C2 with Sheet1
    cell A3 with D:\test\
    cell B3 with 2.xls
    cell C3 with 1-Sheet1
    cell D3 with A1:F1000

    something like this :
    EXCEL_2022-06-21_20-26-42.png

    Make sure that the data in 1.xls and 2.xls is the same with the one you attached in your post.
    Make sure that 1.xls and 2.xls are not open, then run the macro.

    It will open 1.xls and it directly fill column D and E in sheet1 with vlookup formula looking to 2.xls 1-Sheet1 range A1:F1000

  3. #3
    Forum Contributor
    Join Date
    07-28-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    173

    Re: Conditionally copy & paste the data with matching

    Thnx for the Great Help
    Working Perfect

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Copy paste at matching data's sheets
    By RajuN in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-27-2021, 11:16 AM
  2. [SOLVED] Copy & Paste the data Conditionally
    By dumdumbum in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 09-06-2020, 02:36 AM
  3. [SOLVED] Conditionally copy paste the data
    By dumdumbum in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-11-2020, 09:52 AM
  4. [SOLVED] Find matching data, copy data in adjacent cell and paste in new column
    By Bikeman in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-23-2015, 04:08 PM
  5. Conditionally Copy/Paste Data from one Workbook to another
    By justin19 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-02-2013, 04:48 PM
  6. Copy Paste data with matching criteria from different sheet
    By Noor Hussain in forum Excel General
    Replies: 0
    Last Post: 06-14-2012, 01:23 AM
  7. Copy and paste matching data.
    By davidparkes in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2011, 04:19 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1