>Spoke too soon.
>
[quoted text clipped - 28 lines]
>>> |
>>> | Chris.
Long is not that long, less than 1000 characters. I can cope with the
length by formatting cells to wrap, but I need a way of automatically
increasing the height of the cell everytime the text within in it wraps.
I envisage some form of formatting that says if cell contains 1 - 200
characters make height 12.75 pixels, if cell contains 201 -400 characters
make height 25.5 pixels, if cell contains 401 - 600 characters make height
38.25 pixels etc, but don't know if this is possible, and if so how to do
it.
> How long is "long"?
>
[quoted text clipped - 41 lines]
>>>> |
>>>> | Chris.
Gord Dibben - 21 Nov 2007 16:29 GMT
Chris
That's how row>autofit and wrap text work.
Add more text, row adjusts height to fit as long as wrap text is enabled.
If you set all the cells in the row to autofit and wrap text, the cell with the
most text will govern the row height.
BTW: row heights are generally measured in points...............72 points to the
inch.
12.75 points won't show much text unless you have a very wide column.
You could use event code to adjust the row heights to a specific size based upon
string length of a cell.
Something like this.......................
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Dim vRngInput As Range
Set vRngInput = Intersect(Target, Range("B:B"))
n = Target.Row
If vRngInput Is Nothing Then Exit Sub
On Error GoTo endit
Application.EnableEvents = False
For Each rng In vRngInput
Select Case Len(rng)
Case Is <= 200: Num = 12.75
Case Is <= 400: Num = 25.5
Case Is <= 600: Num = 39.25
Case Is > 600: Num = 53.25
End Select
Excel.Range("B" & n).RowHeight = Num
Next rng
endit:
Application.EnableEvents = True
End Sub
Gord
>Long is not that long, less than 1000 characters. I can cope with the
>length by formatting cells to wrap, but I need a way of automatically
[quoted text clipped - 51 lines]
>>>>> |
>>>>> | Chris.
Chris Mitchell - 21 Nov 2007 17:48 GMT
Doh!
Got it. I have to select the entire Row then apply autofit.
Don't work if you try to apply it to individual cells within the row.
Thanks Gord & Niek.
> Chris
>
[quoted text clipped - 102 lines]
>>>>>> |
>>>>>> | Chris.