Cells with varying number of lines

G

GWC

A1 contains one line.
B1 contains one line.
C1 contains one to many lines.
D1 contains two lines.
E1 contains one to many lines.
F1 contains one to many lines.

Now do I paste multiple lines into one cell?

How do I make all cells have the same height as the cell with the most lines?

How do I center vertically the contents in the cells that have less than the most lines?
 
I

isabelle

hi,

here's one for example

Dim c As Range, txt As String
For Each c In Range("A1:F1")
txt = txt & c.Value & Chr(10)
Next
With Range("A2")
.Value = Left(txt, Len(txt) - 1)
.VerticalAlignment = xlCenter
.WrapText = True
.Rows.AutoFit
End With

isabelle

Le 2014-12-04 08:57, GWC a écrit :
 

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