It would be nice if there was a function like =SUM() that would concatenate
vlues rather than sum them. We can make such a function (User Defined
Function):
Function concat(r As Range) As String
Dim rr As Range
concat = ""
For Each rr In r
concat = concat & rr.Value
Next
End Function
User Defined Functions (UDFs) are very easy to install and use:
1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window
If you save the workbook, the UDF will be saved with it.
To remove the UDF:
1. bring up the VBE window as above
2. clear the code out
3. close the VBE window
To use the UDF from Excel:
=concat(A1:A30)
To learn more about macros in general, see:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
or
http://www.cpearson.com/excel/WritingFunctionsInVBA.aspx
for specifics on UDFs