+ Reply to Thread
Results 1 to 5 of 5

Concatenate a variable # of cells based on 1 criteria into a cell then autofit the text

  1. #1
    Registered User
    Join Date
    02-05-2013
    Location
    Indianapolis
    MS-Off Ver
    Excel 2013
    Posts
    3

    Concatenate a variable # of cells based on 1 criteria into a cell then autofit the text

    Hello everyone,

    Using the screenshot example below, I want to create a macro to concatenate the values (starting in row 4) for columns A & C (with ". " in between and a line break at the end of each) based on ANY value in column B (Status) and put that concatenated text in cell C2 in a format like the example below (but stopping after Test Description 7 in this example).

    Also, if possible, I would like to automatically expand or contract the height of Row 2 to fit the contents of C2.
    Concatenate.jpg

    I appreciate any help with this and thank you in advance.

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Concatenate a variable # of cells based on 1 criteria into a cell then autofit the tex

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-05-2013
    Location
    Indianapolis
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Concatenate a variable # of cells based on 1 criteria into a cell then autofit the tex

    Thanks Walruseggman! That got all of the rows concatenated just as I wanted.

    However, I forgot to include in my original description that I would like the first sentence ("The following tests were successfully completed for PCR 97456:") added at the beginning. How would I properly do that?

  4. #4
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Concatenate a variable # of cells based on 1 criteria into a cell then autofit the tex

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-05-2013
    Location
    Indianapolis
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Concatenate a variable # of cells based on 1 criteria into a cell then autofit the tex

    Thanks so much, that did the trick!

    However (again, sorry) C2 is merged together with D2 so the AutoFit doesn't work properly. Is there anything I can do to remedy this without un-merging the two cells?

+ 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. Replies: 2
    Last Post: 01-05-2015, 08:06 PM
  2. Pls help, can we concatenate text based on some criteria lik SUMIFS
    By Shermin in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-22-2013, 04:31 AM
  3. Macro to concatenate or add text to cell value based on another cells value
    By kstrick99999 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2012, 01:00 PM
  4. How to concatenate a variable number of rows/cells based on multiple criteria?
    By jonharadon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-16-2012, 09:22 PM
  5. Need to merge variable number of cells into one single cell based on criteria
    By NewYorkVanilla in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-20-2009, 11:05 AM

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