Tuesday, July 24, 2018
MEMASANG ALT TITLE TAG OTOMATIS BLOGSPOT
MEMASANG ALT TITLE TAG OTOMATIS BLOGSPOT
These are very simple and useful macros to concatenate the content of multiple cells, merging it into one cell.
Macros for Horizontal and Vertical concatenation
Copyright, Andr�s Gonzalez, 2008
Sub mezclar() horizontal concatenation
For Each fila In Selection.Rows
mensaje = ""
For Each celda In fila.Cells
mensaje = mensaje & celda.Value & " "
Next
fila.Clear
fila.Cells(1, 1).Value = mensaje
Next
End Sub
Sub mezclarV() vertical concatenation
For Each columna In Selection.Columns
mensaje = ""
For Each celda In columna.Cells
mensaje = mensaje & "- " & celda.Value & Chr(10)
Next
columna.Clear
columna.Cells(1, 1).Value = mensaje
Next
End Sub
Lets say you have the following table:
| Albert | Einstein |
| Nikola | Tesla |
With the first macro the result will be:
| albert einstein |
| nikola tesla |
And with the second, it will be:
| - albert | - einstein |
I think this one is cool, isnt it?