Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 334
Default Combining text from several cells into 1 cell

I have text from a report that is spread over several cells. Each cell
contains 1 word. I want to bring all of these words into 1 cell, in Sheet1
A2. They come into Sheet1 in cells A1, B1, C1, D1, E1, F1, G1, H1. So A2
will contain all 8 words in 1 cell. Putting a space between words in A2 would
be best.
--
Rick
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Combining text from several cells into 1 cell

Try the below formula in cell A2

=TRIM(A1 & " " & B1 & " " & C1 & " " & D1 & " " & E1 & " " & F1 & " " &
G1 & " " & H1)

Check help on CONCATENATE()

If this post helps click Yes
---------------
Jacob Skaria


"Rick" wrote:

I have text from a report that is spread over several cells. Each cell
contains 1 word. I want to bring all of these words into 1 cell, in Sheet1
A2. They come into Sheet1 in cells A1, B1, C1, D1, E1, F1, G1, H1. So A2
will contain all 8 words in 1 cell. Putting a space between words in A2 would
be best.
--
Rick

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Combining text from several cells into 1 cell

On Oct 23, 10:49*am, Jacob Skaria
wrote:
Try the below formula in cell A2

=TRIM(A1 & " " & B1 *& " " & C1 *& " " & D1 *& " " & E1 *& " " & F1 *& " " &
G1 *& " " & H1)

Check help on CONCATENATE()

If this post helps click Yes
---------------
Jacob Skaria

"Rick" wrote:
I have text from a report that is spread over several cells. *Each cell
contains 1 word. *I want to bring all of these words into 1 cell, in Sheet1
A2. *They come into Sheet1 in cells A1, B1, C1, D1, E1, F1, G1, H1. *So A2
will contain all 8 words in 1 cell. Putting a space between words in A2 would
be best.
--
Rick


Another option... a UDF...

Function ConcatRange(rRange As Range, Optional delim As String = " ")
As String
Dim rCell As Range
ConcatRange = ""
For Each rCell In rRange
ConcatRange = ConcatRange & rCell.Value & delim
Next rCell
ConcatRange = Left(ConcatRange, Len(ConcatRange) - Len(delim))
End Function

Use in A2 as =ConcatRange(A1:H1)
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Combining text from several cells into 1 cell

If looking for a UDF; try the below..(From a previous post)

Syntax:
=CONCATRANGE(rngRange,strDelimiter,blnIgnoreBlank)
rngRange is the Range
strDelimiter Optional . Default is space
blnIgnoreBlank Optional. Default is False

Examples:
'1. Concatenate with default delimiter(space)
=CONCATRANGE(A1:A10)

'2. Concatenate with semicolon as delimiter and ignore blanks
=CONCATRANGE(A1:A10,":",1)

Function CONCATRANGE(rngRange As Range, _
Optional strDelimiter As String = " ", _
Optional blnIgnoreBlank As Boolean = False)
'Jacob Skaria
Dim varTemp As Range
For Each varTemp In rngRange
If blnIgnoreBlank Then
If Trim(varTemp) < vbNullString Then _
CONCATRANGE = CONCATRANGE & strDelimiter & varTemp
Else
CONCATRANGE = CONCATRANGE & strDelimiter & varTemp
End If
Next
CONCATRANGE = WorksheetFunction.Trim(Mid(CONCATRANGE, _
len(strDelimiter)+1))
End Function

If this post helps click Yes
---------------
Jacob Skaria


"Sandeep Warrier" wrote:

On Oct 23, 10:49 am, Jacob Skaria
wrote:
Try the below formula in cell A2

=TRIM(A1 & " " & B1 & " " & C1 & " " & D1 & " " & E1 & " " & F1 & " " &
G1 & " " & H1)

Check help on CONCATENATE()

If this post helps click Yes
---------------
Jacob Skaria

"Rick" wrote:
I have text from a report that is spread over several cells. Each cell
contains 1 word. I want to bring all of these words into 1 cell, in Sheet1
A2. They come into Sheet1 in cells A1, B1, C1, D1, E1, F1, G1, H1. So A2
will contain all 8 words in 1 cell. Putting a space between words in A2 would
be best.
--
Rick


Another option... a UDF...

Function ConcatRange(rRange As Range, Optional delim As String = " ")
As String
Dim rCell As Range
ConcatRange = ""
For Each rCell In rRange
ConcatRange = ConcatRange & rCell.Value & delim
Next rCell
ConcatRange = Left(ConcatRange, Len(ConcatRange) - Len(delim))
End Function

Use in A2 as =ConcatRange(A1:H1)
.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 334
Default Combining text from several cells into 1 cell

Thank you so much for your help. This is just the solution I was looking for.
--
Rick


"Jacob Skaria" wrote:

Try the below formula in cell A2

=TRIM(A1 & " " & B1 & " " & C1 & " " & D1 & " " & E1 & " " & F1 & " " &
G1 & " " & H1)

Check help on CONCATENATE()

If this post helps click Yes
---------------
Jacob Skaria


"Rick" wrote:

I have text from a report that is spread over several cells. Each cell
contains 1 word. I want to bring all of these words into 1 cell, in Sheet1
A2. They come into Sheet1 in cells A1, B1, C1, D1, E1, F1, G1, H1. So A2
will contain all 8 words in 1 cell. Putting a space between words in A2 would
be best.
--
Rick

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 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 & number from different cells ExcelXYZ Excel Discussion (Misc queries) 2 June 25th 06 08:52 AM
combining text from 2 cells stapleton2308 Excel Discussion (Misc queries) 4 February 22nd 06 04:01 PM
Combining Text and numbers from two cells koba Excel Discussion (Misc queries) 4 December 12th 05 05:37 AM


All times are GMT +1. The time now is 04:11 PM.

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"