Jeffrey_1 0 Newbie Poster

I am trying to combine cells depending on the contents of other cells. If Column A has an "X", I want to combine all cells below it, values seperated with a space, until the next line where an "X" appears. There is also data in Column C, which I don't want to be deleted as a result of the above named merge, but preserved in the row which its original associated data was merged. See below for the example of before and after.

BEFORE MACRO

    A   B         C
    x   1 cat   
        2 dogs    Title A 
        3 monkeys   
        4 kitten  
    x   5 apes    Title B
        6 buckets   
        7 mops  

AFTER MACRO

    A   B                               C
    x   1 cat 2 dogs 3 monkeys 4 kitten Title A
    x   5 apes 6 buckets 7 mops         Title B
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.