![]() |
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 ? |
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 ? |
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 ? |
All times are GMT +1. The time now is 12:21 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com