Reputation: 45
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