Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / General Excel Questions / May 2008

Tip: Looking for answers? Try searching our database.

Merging many rows into one cell

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
feliciamm - 14 May 2008 00:31 GMT
hi.  i want to merge many rows in to one cell.  there are many names on
companies i want to display in a flowchart and want to be able to take the
individual rows and make them one cell so i can wrap the cell and format to
the left

-- is there a way to do that?
RagDyer - 14 May 2008 01:47 GMT
=A1&char(10)&A2&char(10)&A3&char(10) ... etc.

Signature

HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

> hi.  i want to merge many rows in to one cell.  there are many names on
> companies i want to display in a flowchart and want to be able to take the
[quoted text clipped - 3 lines]
>
> -- is there a way to do that?
Gord Dibben - 14 May 2008 04:04 GMT
Formula as RagDyer suggests or try a user defined function to get all in one
cell, space delimited.

Function ConCatRange(CellBlock As Range) As String
Dim Cell As Range
Dim sbuf As String
   For Each Cell In CellBlock
       If Len(Cell.text) > 0 Then sbuf = sbuf & Cell.text & " "
   Next
   ConCatRange = Left(sbuf, Len(sbuf) - 1)
End Function

Usage is:  =ConCatRange(a1:a20)

If you're not familiar with VBA and macros/functions, see David McRitchie's site
for more on "getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

or Ron de De Bruin's site on where to store macros.

http://www.rondebruin.nl/code.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + r to open Project Explorer.

Find your workbook/project and select it.

Right-click and Insert>Module.  Paste the code in there.  Save the
workbook and hit ALT + Q to return to your workbook.

In a cell enter the formula as shown above in Usage is:

Gord Dibben  MS Excel MVP

>hi.  i want to merge many rows in to one cell.  there are many names on
>companies i want to display in a flowchart and want to be able to take the
>individual rows and make them one cell so i can wrap the cell and format to
>the left
>
>-- is there a way to do that?

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.