Concatenate function with 200 arguments

T

thang

Hello,

I wish to write a function that can concatenate the
content of 200 or more previous cells.

Many thanks for your help,

Thang
 
T

Tom Ogilvy

dim i as long, sStr as Long
for i = 1 to 2000
sStr = sStr & cells(i,1).Value
Next
debug.print sStr
 
C

Corran Horn

Hello,

I wish to write a function that can concatenate the
content of 200 or more previous cells.

Many thanks for your help,

Thang

Thang,

Try this, using the previous cells as a continuous range as input:

***********************************
Function ConXL(rngMyRange As Range)

Dim i As Integer

For i = 1 To rngMyRange.Columns.Count

ConXL = ConXL & rngMyRange.Value(1, i)

Next i

End Function
***********************************
 
Top