Quantcast
Channel: Comentários sobre: VBA – Concatenando Ranges (Função CONCATENAR)
Viewing all articles
Browse latest Browse all 3

Por: felipemdm

$
0
0

Excelente postagem…

Incrementaria o seguinte, na Funcação Concat2.

Function Concat(myRange As Range, Optional myDelimiter As String)
Dim r As Range
Dim v As String

Application.Volatile
For Each r In myRange
If Len(r.Text) > 0 Then
If r.Text = v Then
Continue For ‘ Dessa forma não haveria duplicidade
End If

Concat = Concat & r & myDelimiter
v = r.Text
End If
Next r
If Len(myDelimiter) > 0 Then
Concat = Left(Concat, Len(Concat) – Len(myDelimiter))
End If
End Function


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images