Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default Concatenate A1, B1, and C1 into D1

I have data in Column A1, B1, and C1. Id like to concatenate all three
cells into one sentence in cell D1. Does anyone have code that can do that?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Concatenate A1, B1, and C1 into D1

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. Id like to concatenate all three
cells into one sentence in cell D1. Does anyone have code that can do that?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default Concatenate A1, B1, and C1 into D1

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. Id like to concatenate all three
cells into one sentence in cell D1. Does anyone have code that can do that?

Reply
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
Concatenate MF Excel Worksheet Functions 4 October 14th 09 05:32 PM
Concatenate/ Min-Max PAL Excel Worksheet Functions 2 October 26th 07 03:34 AM
concatenate with vba Maxi[_2_] Excel Programming 5 July 2nd 07 04:57 PM
Concatenate Jeff Excel Discussion (Misc queries) 4 October 5th 05 04:39 PM
I know how to concatenate ,can one de-concatenate to split date? QUICK BOOKS PROBLEM- New Users to Excel 1 July 26th 05 05:07 PM


All times are GMT +1. The time now is 07:47 AM.

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

About Us

"It's about Microsoft Excel"