I am trying to write a VBA function that will allow me to pass it a single range argument and that returns the concatenation of all the cells in the range.
Very similar to Bong's solution, here is a complete function:
Code:
Function ConcatCells(ByVal oRange As Range) As String
Dim oCell As Range
Dim sResult As String
sResult = ""
For Each oCell In oRange
sResult = sResult & oCell.Text
Next oCell
ConcatCells = sResult
End Function
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.