Concatenate function with 200 arguments

  • Thread starter Thread starter thang
  • Start date Start date
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
 
dim i as long, sStr as Long
for i = 1 to 2000
sStr = sStr & cells(i,1).Value
Next
debug.print sStr
 
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
***********************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top