Cells with varying number of lines

  • Thread starter Thread starter GWC
  • Start date Start date
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?
 
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 :
 
Back
Top