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

Sub ConCat()
Dim v(1 To 9)
Dim i As Long, ii As Long, j As Long
Dim lim As Long, s As String, jj As Long
Dim rng As Range, rng1 As Range
Set rng = Range(Cells(1, 2), Cells(1, "IV").End(xlToLeft))
i = 1
ii = 0
j = 2
lim = Application.Min(rng.Count + 1, 175)
Do While j <= lim
v(i) = v(i) & Cells(1, j).Address(0, 0) & ","
ii = ii + 1
j = j + 1
If j lim Then Exit Do
If ii = 29 Then
ii = 0
i = i + 1
End If
Loop
s = "="
For jj = 1 To i
v(jj) = Left(v(jj), Len(v(jj)) - 1)
s = s & "Concatenate(" & v(jj) & ")&"
Next
s = Left(s, Len(s) - 1)
Set rng1 = Range(Range("B1"), Range("B1").End(xlDown))
rng1.Offset(0, -1).Formula = s

End Sub

--
Regards,
Tom Ogilvy


"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
More Concatenate operation - Any help? Bob Phillips Excel Programming 0 December 8th 06 02:54 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
Conditional operation Shetty Excel Worksheet Functions 1 January 17th 05 01:08 PM
Illegal Operation Angela[_4_] Excel Programming 0 October 3rd 03 03:38 PM


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