+ Reply to Thread
Results 1 to 3 of 3

Text to columns - new row - copy/paste original row

  1. #1
    Registered User
    Join Date
    11-03-2014
    Location
    Ireland
    MS-Off Ver
    2016
    Posts
    43

    Text to columns - new row - copy/paste original row

    Hello again Excel guru community,

    Unfortunately again I have encountered a road-block in my skill-set that is blocking me from developing something in Excel to make my (and my colleagues) days easier!

    We have a data list of 10,000 or so rows and 24 columns. This list is a a central reference point for much of what we work with but it changes a lot, meaning as things change/update we must refresh our own lists that are linked to it. The main thign we reference with our work is contained in column A and most often we work with vlookups to search for the data we need.

    The issue I have is that our vlookups often return errors as the 'food' in Column A is often 'grouped' into 1 cell if it meets the same criteria as other foods. In the attached file I have provided an example of this in cell A11 of the 'Original' tab.
    My goal is to be able to lookup what food is in column A and ensure that and food that is 'grouped' into the same cell does not return an error. I imagine the quickest way to do this is create a macro that finds any food in column A that is grouped and then takes each food and cuts/pastes it into it's own row with the rest of the data in the original row copy/pasted to the new rows. (I am hoping the attached sheets shows this)

    Does anyone have/know a piece of VBA code I can use in my macro to achieve this??

    Luckily, the comma character (,) is the character that will only appear in column A if that cell is 'grouping' several foods.

    Perhaps the method I am have suggested is not the most efficient at achieving what I wish so I am also open to the vast knowledge of you guys!

    Any help at all you could offer would be massively appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Text to columns - new row - copy/paste original row

    I know you asked for a VBA solution.. I'm sure someone will find the time to build you something. But I also wanted to give you a non-vba formula that might come in handy in this case or in simular situations. in a vlookup you can also lookup partial matches with wildcards.. so with the formula below you can find Broccolli in the grouped string

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    but it also works if the value to find is in a cell

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    maybe not the perfect solution, but it might be a nice addition to your skill-set or toolkit to have available..
    see attachment file for testing
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    11-03-2014
    Location
    Ireland
    MS-Off Ver
    2016
    Posts
    43

    Re: Text to columns - new row - copy/paste original row

    That is indeed a nice little trick to have, many thanks Roel

+ 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 and paste values but retain original rows.
    By JumpyJim in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-06-2017, 01:33 PM
  2. Keeping track of the original file when you copy/paste
    By sidbisk in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-02-2015, 01:58 PM
  3. Copy and paste from master workbook but keep original filepaths
    By awd2013 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-16-2015, 06:25 AM
  4. Copy/Paste Referencing Only Original Cell (Conditional Formatting)
    By JONBOY666 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-30-2013, 06:26 PM
  5. [SOLVED] how can i copy paste data with the original cell formats?
    By sumesh56 in forum Excel General
    Replies: 2
    Last Post: 04-16-2013, 09:45 PM
  6. copy and paste without referencing original sheet
    By tinkerist in forum Excel General
    Replies: 3
    Last Post: 04-07-2012, 08:26 PM
  7. [SOLVED] Why does Excel Copy and Paste change dates from the original when.
    By Excel changes dates in copy an in forum Excel General
    Replies: 5
    Last Post: 01-26-2005, 02:06 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