#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default selecting a range

I just learned about the CONCATENATE function and it seems like what I need
but I often have a good number of cells to pick my data from. Is there a way
to select a range of cells, like A1:A5, in lieu of selecting each individual
cell A1,A2,A3,A4,A5 ?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,805
Default selecting a range

I don't think you can do that...

I use an helper column
Enter
=A1 in B1
Enter
=B1 & ", ", A2 in B2
and copy down...

Last cell gives me the concatenation of all cells in Col A, upto that row.

"Garth" wrote:

I just learned about the CONCATENATE function and it seems like what I need
but I often have a good number of cells to pick my data from. Is there a way
to select a range of cells, like A1:A5, in lieu of selecting each individual
cell A1,A2,A3,A4,A5 ?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default selecting a range

Garth

You could use this UDF to select a range.

Results would be comma de-limited. Adjust that to suit.

Function ConCatRange(CellBlock As Range) As String
'for a single range =ConCatRange(A1:A10)
'for non-contiguous ranges =ccr((a1:a10,c4,c6,e1:e5))
Dim Cell As Range
Dim sbuf As String
For Each Cell In CellBlock
If Len(Cell.text) 0 Then sbuf = sbuf & Cell.text & ","

'adjust "," to suit like " " for space de-limited

Next
ConCatRange = Left(sbuf, Len(sbuf) - 1)
End Function

Also ignores blank cells in the range.


Gord Dibben MS Excel MVP

On Wed, 4 Mar 2009 10:58:01 -0800, Garth
wrote:

I just learned about the CONCATENATE function and it seems like what I need
but I often have a good number of cells to pick my data from. Is there a way
to select a range of cells, like A1:A5, in lieu of selecting each individual
cell A1,A2,A3,A4,A5 ?


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
Please help with selecting a range keri Excel Discussion (Misc queries) 7 December 12th 06 08:56 PM
Selecting range in list of range names depending on a cell informa Courreges Excel Discussion (Misc queries) 2 June 19th 06 10:59 AM
Selecting a Range SJT Excel Discussion (Misc queries) 2 March 8th 06 07:30 PM
Selecting a cell in a range Coolboy55 Excel Worksheet Functions 0 August 31st 05 07:17 PM
selecting range with "End + direction" mehdi Excel Discussion (Misc queries) 4 March 9th 05 12:46 PM


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