+ Reply to Thread
Results 1 to 3 of 3

Automatically concatenate text in cells containing specific text

  1. #1
    Registered User
    Join Date
    04-25-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    24

    Question Automatically concatenate text in cells containing specific text

    Hi all,

    I have what I hope is a simple problem to resolve.

    I have a spreadsheet which contains rows called "Sample ID" and "Asbestos Content" (see attached example).

    Where a cell in the "Sample ID" column contains the words "Visually Consistent with...", I need to
    a) add parentheses around the Asbestos Content cell beside it in the same row,
    b) concatenate the text in the "Sample ID" and "Asbestos Content" cells in the same row into the "Asbestos Content" cell, with a hard return separating the concatenated text, and
    c) Insert the text string "Not Sampled" in the "Sample ID" cell from the row being altered.

    This isn't too hard to do manually using the concatenate formula, but not being able to automate the process over hundreds of rows in some cases is driving me nuts.

    I've attached both a large dataset in need of this automation, and an example spreadsheet with "before and after" examples. The latter contains two pairs of two rows highlighted in blue and in purple. In each pair of rows the top is what I have currently and the bottom is what I want these cells to all look like.

    Any help is greatly appreciated.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Automatically concatenate text in cells containing specific text

    Hello cmaunder,

    This macro has been added to the attached workbook. There is a button on the worksheet to run it.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    04-25-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Automatically concatenate text in cells containing specific text

    Sorry for the late reply Leith, but thanks very much. Works like a charm, and I've learned a few things in the process. Thanks again!

+ 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. Concatenate specific cells if it has text inside
    By Repo1982 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-20-2013, 11:29 PM
  2. Replies: 0
    Last Post: 03-12-2013, 04:29 PM
  3. [SOLVED] Return specific text if a different text is contained anywhere in a range of cells
    By ciayers in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-06-2013, 05:54 PM
  4. Replies: 1
    Last Post: 04-27-2012, 07:24 AM
  5. Concatenate cells and add text
    By Rick_Stanich in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-10-2009, 05:10 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