LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default VBA: Concatenate with carriage returns

I think this might be an interesting challenge for someone!

I want to concatenate text in three columns, which would normally be a
simple worksheet function.

However, if we look at the cells across the three columns, each contains a
set
of data using carriage returns (essentially like an Alt-Enter).

I have no control over the way this data is fed to me as it comes from a
database I subscribe to. To put some context on the problem, A is First Name,
B is Middle Name, C is Surname.

The data would look like:
A B C
1 David Robert Hughes
Mark Dave Marriott
Martin Benjamin Murray
2 Shaun Andrew Flannagan
Alison Jane Martin

So I would like to combine the data into some sort of output that will lead
to the following, with each:
1 David Robert Hughes
Mark Dave Marriott
Martin Benjamin Murray
2 Shaun Andrew Flannagan
Alison Jane Martin

It is worth noting that some cells may contain no carriage return entries,
while others may have anything up to 20 returns.

After some thought, it would make sense for the data to stay in carriage
return format as no further Excel analysis needs to be performed, and my next
step will be to import the data from each cell into PowerPoint for
presentation purposes, with each cell imported to a seperate slide in a
PowerPoint presentation.

After posting on the Worksheet Functions forum that the only way to do this
without VBA looks to be by using the Text to Columns feature and specifying
the carriage returns as the deliminator. This is very messy and would result
in extra rows.

I have basis working knowledge of VBA, so should be able to decypher a reply!

Is anyone able to help with some VBA script (marked-up so I can see what its
doing!) and pointers?

Many thanks,

Rob
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Carriage returns - how to get rid of them (again) Andrewsan Excel Discussion (Misc queries) 8 March 28th 07 10:15 AM
Carriage returns in the formula bar? rubeus Excel Worksheet Functions 4 July 6th 06 06:05 PM
Concatenate columns with cell data containing Carriage Returns Rob Excel Worksheet Functions 3 October 4th 05 08:49 AM
Concatenate cells with carriage returns Rob Excel Worksheet Functions 1 October 3rd 05 06:25 PM
Carriage returns tracyt620 Excel Discussion (Misc queries) 1 July 7th 05 02:52 PM


All times are GMT +1. The time now is 12:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"