Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Sub concatena_colunas()
- Dim coluna_01 As Long
- Dim coluna_02 As Long
- Dim linha As Long
- On Error GoTo sair:
- 'Armazena e coloca em ordem crescente
- coluna_01 = Selection.Areas(1).Column
- If Selection.Areas(2).Column < coluna_01 Then
- coluna_02 = Selection.Areas(1).Column
- coluna_01 = Selection.Areas(2).Column
- Else
- coluna_02 = Selection.Areas(2).Column
- End If
- linha = ActiveCell.Row
- Do
- Cells(linha, coluna_01).Value = Cells(linha, coluna_01).Value & " " & Cells(linha, coluna_02).Value
- linha = linha + 1
- Loop While Cells(linha, coluna_01).Value <> Empty
- coluna_01 = 0
- coluna_02 = 0
- linha = 0
- sair:
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement