PC Review


Reply
Thread Tools Rate Thread

Concatenate A1, B1, and C1 into D1

 
 
TGalin
Guest
Posts: n/a
 
      24th Mar 2010
I have data in Column A1, B1, and C1. I’d like to concatenate all three
cells into one sentence in cell D1. Does anyone have code that can do that?
 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      24th Mar 2010
Hi,

I'm guessing here that it's not just A1, b1 & C1 you want but if you do why
not this in d1

=a1&b1&c1

If it's a column of data then try this

Sub marine()
Dim lastrow As Long
Dim C As Range
Set sht = Sheets("Sheet1") 'Change to suit
lastrow = sht.Cells(Cells.Rows.Count, "A").End(xlUp).Row
Set MyRange = sht.Range("A1:A" & lastrow)
For Each C In MyRange
C.Offset(, 3) = C & C.Offset(, 1) & C.Offset(, 2)
Next
End Sub

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"TGalin" wrote:

> I have data in Column A1, B1, and C1. I’d like to concatenate all three
> cells into one sentence in cell D1. Does anyone have code that can do that?

 
Reply With Quote
 
TGalin
Guest
Posts: n/a
 
      24th Mar 2010
Eureka! just what the doctor ordered. Thank you my friend this operates very
well.

"Mike H" wrote:

> Hi,
>
> I'm guessing here that it's not just A1, b1 & C1 you want but if you do why
> not this in d1
>
> =a1&b1&c1
>
> If it's a column of data then try this
>
> Sub marine()
> Dim lastrow As Long
> Dim C As Range
> Set sht = Sheets("Sheet1") 'Change to suit
> lastrow = sht.Cells(Cells.Rows.Count, "A").End(xlUp).Row
> Set MyRange = sht.Range("A1:A" & lastrow)
> For Each C In MyRange
> C.Offset(, 3) = C & C.Offset(, 1) & C.Offset(, 2)
> Next
> End Sub
>
> --
> Mike
>
> When competing hypotheses are otherwise equal, adopt the hypothesis that
> introduces the fewest assumptions while still sufficiently answering the
> question.
>
>
> "TGalin" wrote:
>
> > I have data in Column A1, B1, and C1. I’d like to concatenate all three
> > cells into one sentence in cell D1. Does anyone have code that can do that?

 
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 with vba Maxi Microsoft Excel Programming 5 2nd Jul 2007 04:57 PM
I know how to concatenate ,can one de-concatenate to split date? =?Utf-8?B?UVVJQ0sgQk9PS1MgUFJPQkxFTS0=?= Microsoft Excel New Users 1 26th Jul 2005 05:07 PM
concatenate john Microsoft Access 3 4th Aug 2004 09:59 PM
CONCATENATE lehigh@nni.com Microsoft Excel Worksheet Functions 1 7th Oct 2003 01:58 PM
Concatenate Pam Microsoft Excel Worksheet Functions 3 29th Aug 2003 03:15 PM


Features
 

Advertising
 

Newsgroups
 


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