Sebastian Cánepa
Sebastian Cánepa

Reputation: 45

JOIN function parameters

How can I pass a range to my function for example I have uperlimit and lowerlimit. uperlimit=x_row lowerlimit=y_row

CONCATENARCELDAS(B21:B31)

I want something like this but is not working

CONCATENARCELDAS("B"&uperlimit:"B"&lowerlimit)

code that concatenate values

Function CONCATENARCELDAS(Rango As Range)
For Each Celda In Rango.Cells

If Celda.Value <> "" Then
    resultado = resultado & " | " & Celda.Offset(0, -1)

End If

Next Celda

resultado = Right(resultado, Len(resultado) - 2)

CONCATENARCELDAS = resultado

End Function

Upvotes: 0

Views: 35

Answers (1)

Scott Craner
Scott Craner

Reputation: 152525

Use INDEX:

=CONCATENARCELDAS(INDEX(B:B,E1):INDEX(B:B,E2))

enter image description here

Upvotes: 2

Related Questions