Shift all text into one cell


S

Skipper

If I have three cells that have text in them that are next to each
other is there a way to move all the text into one cell?

(Not with a formula, actually move the text)
 
Ad

Advertisements

D

Don Guillett

Without more detail, place your cursor on the left most cell in the row

Option Explicit
Sub movetext()
Dim r, c, lc, i As Long
Dim ms As String
r = ActiveCell.Row
c = ActiveCell.Column
lc = Cells(r, Columns.Count).End(xlToLeft).Column
For i = c To lc
ms = ms & " " & Cells(r, i)
Cells(r, i).ClearContents
Next i
'MsgBox ms
Cells(r, c) = ms
End Sub
 
G

Gord Dibben

Cut and paste in the formula bar?

Or Don's macro


Gord Dibben MS Excel MVP
 
P

Paul Hyett

If I have three cells that have text in them that are next to each
other is there a way to move all the text into one cell?

(Not with a formula, actually move the text)
I can't see how you could do exactly as you specify, without laborious
cut/paste.

Personally, I'd use the Concatenate function.
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top