Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 58
Default Combining Cell Contents

Good afternoon. I know you can either use the concatenate function or the
formula =A1&B1 to combine cell contents.

However, if I am combining contents from 100 different cells, individually
selecting the cells become more cumbersome.

Is there a way to short cut this formula to pick up a range of cells I need
to combine the contents for?-- kind of how the reverse function of it works
for Text to Columns?

Thank you very much,
Storm
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Combining Cell Contents

No shorthand method without some VBA.

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 & ","
'change the comma(",") to your choice of separator
Next
ConCatRange = Left(sbuf, Len(sbuf) - 1)
End Function

Usage is: =ConCatRange(A1:A100)

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

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

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

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 InsertModule. Paste the code in there.

Save the workbook and hit ALT + Q to return to Excel window

Enter the formula in a helper cell as explained above.

There is another VBA method which allows selecting non-contiguous cells and
placing into one cell.

See the macro I posted here at this URL

http://snipurl.com/1ge76


Gord Dibben MS Excel MVP

On Fri, 13 Apr 2007 13:22:03 -0700, Storm
wrote:

Good afternoon. I know you can either use the concatenate function or the
formula =A1&B1 to combine cell contents.

However, if I am combining contents from 100 different cells, individually
selecting the cells become more cumbersome.

Is there a way to short cut this formula to pick up a range of cells I need
to combine the contents for?-- kind of how the reverse function of it works
for Text to Columns?

Thank you very much,
Storm


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 58
Default Combining Cell Contents

WOW! Thank you very much Gord!

No one was responding so I tried to post it under the General Questions and
then I saw your message.

Thanks again for your help!
Storm

"Gord Dibben" wrote:

No shorthand method without some VBA.

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 & ","
'change the comma(",") to your choice of separator
Next
ConCatRange = Left(sbuf, Len(sbuf) - 1)
End Function

Usage is: =ConCatRange(A1:A100)

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

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

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

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 InsertModule. Paste the code in there.

Save the workbook and hit ALT + Q to return to Excel window

Enter the formula in a helper cell as explained above.

There is another VBA method which allows selecting non-contiguous cells and
placing into one cell.

See the macro I posted here at this URL

http://snipurl.com/1ge76


Gord Dibben MS Excel MVP

On Fri, 13 Apr 2007 13:22:03 -0700, Storm
wrote:

Good afternoon. I know you can either use the concatenate function or the
formula =A1&B1 to combine cell contents.

However, if I am combining contents from 100 different cells, individually
selecting the cells become more cumbersome.

Is there a way to short cut this formula to pick up a range of cells I need
to combine the contents for?-- kind of how the reverse function of it works
for Text to Columns?

Thank you very much,
Storm



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Combining Cell Contents

Thanks for the feedback.


Gord Dibben MS Excel MVP

On Fri, 13 Apr 2007 15:44:03 -0700, Storm
wrote:

WOW! Thank you very much Gord!

No one was responding so I tried to post it under the General Questions and
then I saw your message.

Thanks again for your help!
Storm

"Gord Dibben" wrote:

No shorthand method without some VBA.

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 & ","
'change the comma(",") to your choice of separator
Next
ConCatRange = Left(sbuf, Len(sbuf) - 1)
End Function

Usage is: =ConCatRange(A1:A100)

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

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

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

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 InsertModule. Paste the code in there.

Save the workbook and hit ALT + Q to return to Excel window

Enter the formula in a helper cell as explained above.

There is another VBA method which allows selecting non-contiguous cells and
placing into one cell.

See the macro I posted here at this URL

http://snipurl.com/1ge76


Gord Dibben MS Excel MVP

On Fri, 13 Apr 2007 13:22:03 -0700, Storm
wrote:

Good afternoon. I know you can either use the concatenate function or the
formula =A1&B1 to combine cell contents.

However, if I am combining contents from 100 different cells, individually
selecting the cells become more cumbersome.

Is there a way to short cut this formula to pick up a range of cells I need
to combine the contents for?-- kind of how the reverse function of it works
for Text to Columns?

Thank you very much,
Storm




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Combining Cell Contents

Copy your range paste it into notepad copy from a notepad select a
blank cell paste it into a formula bar not directly in a cell press enter


"Storm" wrote:

Good afternoon. I know you can either use the concatenate function or the
formula =A1&B1 to combine cell contents.

However, if I am combining contents from 100 different cells, individually
selecting the cells become more cumbersome.

Is there a way to short cut this formula to pick up a range of cells I need
to combine the contents for?-- kind of how the reverse function of it works
for Text to Columns?

Thank you very much,
Storm



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 Cell Contents - entire columns SV Excel Worksheet Functions 7 December 11th 06 11:30 PM
Combining cell contents when there is content to combine Richard Excel Discussion (Misc queries) 2 June 21st 06 07:30 PM
Combining Row Contents! via135 Excel Worksheet Functions 4 January 19th 06 05:35 PM
Macro to remove contents of cell and move all other contents up one row adw223 Excel Discussion (Misc queries) 1 July 1st 05 03:57 PM
Cell contents vs. Formula contents Sarah Excel Discussion (Misc queries) 3 December 15th 04 06:02 PM


All times are GMT +1. The time now is 09:44 PM.

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

About Us

"It's about Microsoft Excel"