Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Combining Text From Cells

If I have 100 cells that contain text and I want to write an Excel
formula that will combine all cell texts into cell without using
=a1&a2&a3 what would I do? The volume of cells is too large to use
the & in the formula and the transpose feature does not combine text
into one cell.

A1 = one
A2 = two
A3 = three
A4 = four
A5 = five


I want B1 to = one
two
three
four
five
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 621
Default Combining Text From Cells

You really want them stacked as per your B1 example?

Set B1 to wraptext and row 1 to autofit.

Function ConRange(CellBlock As Range) As String
For Each Cell In CellBlock
ConRange = ConRange & Cell.Value & Chr(10)
Next
End Function

=ConRange(A1:A100) entered in B1

Chr(10) is a linefeed....................remove the & Chr(10) if you
don't need it.


Gord

On Fri, 13 Jan 2012 08:49:06 -0800 (PST),
wrote:

If I have 100 cells that contain text and I want to write an Excel
formula that will combine all cell texts into cell without using
=a1&a2&a3 what would I do? The volume of cells is too large to use
the & in the formula and the transpose feature does not combine text
into one cell.

A1 = one
A2 = two
A3 = three
A4 = four
A5 = five


I want B1 to = one
two
three
four
five

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default Combining Text From Cells

How about this one-liner macro...

Sub JoinColumnA()
Range("B1").Value = Join(WorksheetFunction.Transpose(Range("A1:A" & _
Cells(Rows.Count, "A").End(xlUp).Row)), vbLf)
End Sub

Rick Rothstein (MVP - Excel)
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Combining Text From Cells

On Jan 14, 3:14*pm, "Rick Rothstein"
wrote:
How about this one-liner macro...

Sub JoinColumnA()
* Range("B1").Value = Join(WorksheetFunction.Transpose(Range("A1:A" & _
* * * * * * * * * * * Cells(Rows.Count, "A").End(xlUp).Row)), vbLf)
End Sub

Rick Rothstein (MVP - Excel)


This works great....thank you !!
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
Combining cells with text Nadine Excel Worksheet Functions 2 May 5th 10 06:23 PM
Combining text cells. johnnyz197034 Excel Discussion (Misc queries) 2 April 4th 07 09:28 PM
Combining text from different Cells IF henrymartz Excel Discussion (Misc queries) 1 August 16th 06 07:53 PM
combining text from 2 cells stapleton2308 Excel Discussion (Misc queries) 4 February 22nd 06 05:01 PM
Combining Text and numbers from two cells koba Excel Discussion (Misc queries) 4 December 12th 05 06:37 AM


All times are GMT +1. The time now is 09:36 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"