Formatting Text in one cell Vertically

E

EMZAM

Trying to vertically format blocks of text each containing 4 characters in
length.
Shown here as received in "horizontal format".
ABCD GFDR BGVH ARDG etc. etc.
These must be formatted vertically in one cell.
I manually type ALT enter in the space between each thereby formatting down
each 4 to make a vertical column in one cell...
ABCD
GFDR
BGVD
ARGD
Can you suggest a more automated way to do this formatting of text rather
than having to go typing ALT ENTER each time?
 
B

Bob Phillips

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$1" Then

Target.Value = Replace(Target.Value, " ", Chr(10))
End If
End Sub


'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
S

Stefi

If you set column width to length of four characters and format cells "wrap
ON" then Excel will display cell content in the required way.

Regards,
Stefi


„EMZAM†ezt írta:
 

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