Results 1 to 5 of 5

Thread: Copy and paste row when code no is matched

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2021
    Posts
    9

    Copy and paste row when code no is matched

    Hi,

    We have Three excel files. 1. Master 2. MRP & other update 3.Sent
    A sample file attached with this post.

    We frequently note the price and size in "MRP & other update"
    In both file "Code" no is common

    Point1
    how can we do that by vba, I mean when we note any mrp or any thing then entire row copy and paste in Master File where the code is same

    Point2
    and after copy all the row from from "MRP & other update" to "Master File".
    In "Sent" file we want copy entire and all the row from "Master" file where we have changed the mrp or anything

    We have added new mrp in "MRP & other update", and want to update it as above we have said.
    Attached Files Attached Files

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

    Re: Copy and paste row when code no is matched

    We frequently note the price and size in "MRP & other update"
    In both file "Code" no is common
    is common to what? i don not see a price in MRP

    Point1
    how can we do that by vba, I mean when we note any mrp or any thing then entire row copy and paste in Master File where the code is same
    does this mean to overwrite any existing information for that code?

    Point2
    and after copy all the row from from "MRP & other update" to "Master File".
    In "Sent" file we want copy entire and all the row from "Master" file where we have changed the mrp or anything

    We have added new mrp in "MRP & other update", and want to update it as above we have said.
    i am not sure i understand this requirements at all
    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
    New Member
    Join Date
    Jan 2021
    Posts
    9

    Re: Copy and paste row when code no is matched

    Hi,

    Please consider Price as MRP, you can take it typo mistake

    Point1 - Yes you are right, overwrite the data

    Point2 - we just want all the details which were changed in Master File

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

    Re: Copy and paste row when code no is matched

    to clarify
    so in the sample files you want the 2 rows to overwrite the the lines in master with the matching codes?
    and the lines to be added to the sent workbook? or in this case as they are already there nothing to be added? or as the details have been changed, overwrite or add?

    this is all pretty easy to do, if i can figure out the desired result
    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

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2021
    Posts
    9

    Re: Copy and paste row when code no is matched

    o.k. waiting

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