I am filling a cell in a row with text, usually more than one sentence, and merging it with several other cells, wrapping the text and then autofitting the entire row.
This works perfectly, when the data is contained to one line. When there is more than one line the autofit doesn't expand the row height to fit the extra data.
I need my program to automatically expand the height of the row to accommodate multiple lines of data in that row.
Here is a sample of my routine language for review:
ws1.Range("i" & I, "i" & x).Copy Destination:=ws.Cells(17, 2)
With ws.Range("b" & 17, "b" & 21)
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlCenter
.WrapText = True
End With
ws.Range("b" & 17, "j" & 17).Merge
ws.Range("b" & 17, "j" & 17).WrapText = True
ws.Range("b" & 17, "j" & 17).EntireRow.AutoFit
It looks like this:
and I want it to look like this:
This works perfectly, when the data is contained to one line. When there is more than one line the autofit doesn't expand the row height to fit the extra data.
I need my program to automatically expand the height of the row to accommodate multiple lines of data in that row.
Here is a sample of my routine language for review:
ws1.Range("i" & I, "i" & x).Copy Destination:=ws.Cells(17, 2)
With ws.Range("b" & 17, "b" & 21)
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlCenter
.WrapText = True
End With
ws.Range("b" & 17, "j" & 17).Merge
ws.Range("b" & 17, "j" & 17).WrapText = True
ws.Range("b" & 17, "j" & 17).EntireRow.AutoFit
It looks like this:
The eggs are most likely too old to use.The eggs are most likely too old to use. | |
| |
The eggs are fine. |
and I want it to look like this:
The eggs are most likely too old to use. |
There is too much information to fit on one line, so I have to manually expand it to fit. There is too much information to fit on one line, so I have to manually expand it to fit. There is too much information to fit on one line, so I have to manually expand it to fit. There is too much information to fit on one line, so I have to manually expand it to fit. |
The eggs are fine. |