View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
James Ravenswood James Ravenswood is offline
external usenet poster
 
Posts: 143
Default concatenate a range of data

Hi-light the range and run Builder, then select an empty cell and run Putter. Here are the macros:

Dim sf As String

Sub builder()
sf = ""
For Each r In Selection
If sf = "" Then
sf = "=" & r.Address
Else
sf = sf & "&" & r.Address
End If
Next
sf = Replace(sf, "$", "")
MsgBox sf
End Sub

Sub putter()
ActiveCell.Formula = sf
End Sub