Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default More Concatenate operation - Any help?

Create a UDF

Function JoinCells(rng As Range, Optional Delimiter As String = ",")
Dim tmp As String

If rng.Columns.Count 1 Then
If rng.Rows.Count 1 Then
JoinCells = CVErr(xlErrRef)
Exit Function
End If
tmp = Join(Application.Transpose(Application.Transpose(r ng)),
Delimiter)
Else
tmp = Join(Application.Transpose(rng), Delimiter)
End If
If Len(Delimiter) 0 Then
Do Until Right(tmp, 1) < Delimiter
tmp = Left(tmp, Len(tmp) - 1)
Loop
End If
JoinCells = tmp
End Function


and use like

=JoinCells(B1:M1,"")

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Vadhimoo" wrote in message
...
Hi,
I am having a more data in every column(around 100 columns..).
I want to do concatenate all the cell values into the first column
(A1=CONCATENATE(B1,C1,D1,..DC)
A2=CONCATENATE(B2,C2,D2,....EA)

Any macro? because total no of columns value may be changed.

Thanks in advance for your reply.




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
Database operation Oldjay Excel Programming 6 October 11th 06 06:30 PM
what does $ operation mean JO New Users to Excel 1 December 15th 05 11:42 PM
I know how to concatenate ,can one de-concatenate to split date? QUICK BOOKS PROBLEM- New Users to Excel 1 July 26th 05 05:07 PM
ilegal operation emilija Links and Linking in Excel 1 January 20th 05 12:24 AM
Conditional operation Shetty Excel Worksheet Functions 1 January 17th 05 01:08 PM


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