Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 192
Default Concatenate question

Gord, you have alleviated hours of frustration on this issue for me. Thank
you.

"Gord Dibben" wrote:

Nick

Can you work with a User Defined Function?

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

You can enter a range like =ConCatRange(A:A)

The UDF will not return blank cells and when cells are inserted or deleted, the
results will reflect that.

As written, a comma is inserted between each cell value.


Gord Dibben MS Excel MVP

On Thu, 27 Jul 2006 14:27:02 -0700, Nick wrote:

I have a dynamic list entered in columns. I am trying to take one of those
columns and concatenate it into a single cell to be copied directly to a
separate form in the format required. My problem is that the list is dynamic
in both the number of records and the data. It is impractical to constantly
modify the concatenate statement that provides the final product to copy and
paste into my form. Is there any way to concatenate an entire column into
one cell like this dynamically?



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
Newbie With A Question Michael Excel Worksheet Functions 0 July 28th 05 11:50 PM
Anybody Help with previous question Anthony Excel Discussion (Misc queries) 1 July 26th 05 01:26 PM
Pasting Question Metalteck Excel Discussion (Misc queries) 3 July 15th 05 06:44 PM
Concatenate function - keeping "displayed" extra digits EricKei Excel Discussion (Misc queries) 3 June 15th 05 10:16 PM
Hints And Tips For New Posters In The Excel Newsgroups Gary Brown Excel Worksheet Functions 0 April 15th 05 05:47 PM


All times are GMT +1. The time now is 08:05 AM.

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"