I think this question is more properly suited to the Programming forum.

'COLUMNS TO ROWS
Here's a macro for merging columns of data to one row matching for column A, it's exactly the thing you've described..There's a sample sheet there where you can test it out.