+ Reply to Thread
Results 1 to 2 of 2

Copy values based on matching text

  1. #1
    Registered User
    Join Date
    11-29-2018
    Location
    Dillington, North Hampshire
    MS-Off Ver
    2016
    Posts
    1

    Copy values based on matching text

    Hi Everyone,

    first of all congratulations for all the good you do to people who need help in excel, like i do now.

    I need VBA Code for a Makro for the following Scenario.


    I have a list of Materials and their respective serial numbers. The Items are grouped by a Material-Family identifier. All Materials are stored in a container.
    The Goal is to be able to see in the same row, for each Material, which cotainer it is being stored in.

    The List is structured as follows:
    • In Cell A2 to A? there is an Identifier for a Family of Items belonging together
    • In Cell B2 to B? I have Material Codes. One of the Material Codes is the Container which contains all materials of one material family.
    • In Cells C2 to C? i have Serial numbers of all Items. One of the Serial Numbers is the Serial Number of the container

    What does my code need to do ?

    To populate the Information "Containername" and "Serial Number of the Container" to Cells Dx and Ex of each material belonging to the same material family (Identified in Cell A) as the container.

    If the code finds the String "Container" in any cell of Column B it needs to populate the full string e.g "Container 1" and "Serial Number of the Container" found in Cell C, to Cells D and E of every material that belongs to the same material family as the container mentioned in Column A.

    So basically i need to go from this:
    A B C D E
    1 Family Material Serialnumber Container ID Serial Number Container
    2 1 Material Serial Number of Material
    3 1 Material Serial Number of Material
    4 1 Container1 Serial Number of Container1
    5 2 Material Serial Number of Material
    6 2 Material Serial Number of Material
    7 2 Container 2 Serial Number of Container 2

    To This:
    A B C D E
    1 Family Material Serialnumber Container ID Serial Number Container
    2 1 Material Serial Number of Material Container 1 Serial Number of Container1
    3 1 Material Serial Number of Material Container 1 Serial Number of Container1
    4 1 Container1 Serial Number of Container1 Container 1 Serial Number of Container1
    5 2 Material Serial Number of Material Container 2 Serial Number of Container2
    6 2 Material Serial Number of Material Container 2 Serial Number of Container2
    7 2 Container 2 Serial Number of Container 2 Container 2 Serial Number of Container2

    Can anyone help me with the code or at least point me to the functions i would need to use?
    Thanx a lot in advance. Tom
    Last edited by mgviper; 11-29-2018 at 07:30 PM.

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Copy values based on matching text

    This seemed to work OK.
    Please Login or Register  to view this content.
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

+ 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. [SOLVED] Copy and paste to one row based on matching values
    By mhf89 in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 03-14-2017, 10:03 PM
  2. Replies: 7
    Last Post: 03-18-2016, 05:09 AM
  3. Code to search for matching values in two columns, take text from that row and copy
    By Excelsemi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-23-2014, 12:12 PM
  4. [SOLVED] Find matching text string and copy values from 5-rows below it.
    By javeds in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-29-2014, 03:06 PM
  5. Replies: 2
    Last Post: 04-11-2013, 11:14 AM
  6. Replies: 6
    Last Post: 01-22-2012, 12:39 PM

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