Text into one cell
Hi
This should do it
Public Sub tester()
Dim Testrange as Range, Cell as Range
Dim TestString as String
On Error Resume Next
Set Testrange = Selection
If Not Testrange Is Nothing Then
For Each Cell In Testrange
TestString = TestString & " " & Cell.Text
Next Cell
Testrange.Cells(1, 1).Value = Trim(TestString)
End If
Set Testrange = Nothing
End Sub
The error message bit is just in case you have graphic or some such
selected.
regards
Paul
Trond wrote:
Hi!
I have text spread in several cells and want the text to be gathered into
one cell.
|