PC Review


Reply
Thread Tools Rate Thread

Concatenate text from columns

 
 
Saintsman
Guest
Posts: n/a
 
      1st Dec 2009
How can I concatenate text in colB?
ColA has 2 markers C and *
Whenever C is followed by * I need to unite the text fields in ColB
So, for the data below I want
ColA ColB
C Text1 Text1a
C Text2 Text2a Text2b Text2c

ColA ColB
C Text1
* Text1a cont'd
C Text2
* Text2a cont'd
* Text2b cont'd
* Text2c cont'd
C Text3

Hope this makes sense!
 
Reply With Quote
 
 
 
 
JBeaucaire
Guest
Posts: n/a
 
      1st Dec 2009
Try this:

=======
Sub MergeTexts()
'JBeaucaire (12/1/2009)
Dim LR As Long, i As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
i = 2

Do Until Len(Range("A" & i)) = 0
If Range("A" & i) = "*" And Range("A" & i - 1) = "C" Then
Range("B" & i - 1) = Range("B" & i - 1) & " " & Range("B" & i)
Rows(i).Delete xlShiftUp
Else
i = i + 1
End If
Loop

End Sub
========

--
"Actually, I *am* a rocket scientist." -- JB
(www.MadRocketScientist.com)

Your feedback is appreciated, click YES if this post helped you.


"Saintsman" wrote:

> How can I concatenate text in colB?
> ColA has 2 markers C and *
> Whenever C is followed by * I need to unite the text fields in ColB
> So, for the data below I want
> ColA ColB
> C Text1 Text1a
> C Text2 Text2a Text2b Text2c
>
> ColA ColB
> C Text1
> * Text1a cont'd
> C Text2
> * Text2a cont'd
> * Text2b cont'd
> * Text2c cont'd
> C Text3
>
> Hope this makes sense!

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
CONCATENATE TWO COLUMNS The Cable Guy Microsoft Excel Worksheet Functions 3 16th Dec 2009 04:37 AM
concatenate two columns ranjan.khan@comcast.net Microsoft Excel Discussion 3 15th Mar 2007 04:29 PM
Concatenate two columns? uma Microsoft Excel Worksheet Functions 1 19th Apr 2006 09:46 AM
Re: Concatenate 3 columns. Jim15 Microsoft Excel Programming 0 23rd Feb 2006 05:08 PM
Concatenate 3 columns. Jim15 Microsoft Excel Programming 0 23rd Feb 2006 05:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:25 AM.