General discussion

Locked

Excel cell size

By kelley.hecke ·
How can I globally reduce the height of rows with wrapped text cells in an Excel file to 100 if and only if they are more than 100 in height? The reason I would like this feature is because I cannot always see the top line of text in a cell on myCRT screen if the row height exceeds 100. Many row heights do not exceed 100 and I don't wish to change all row heights to 100. Currently I have to adjust each row with a height of 100 or more by right clicking on the row heading, selecting "row height" and setting it to 100.

If you know of another way that I can read the top line of all wrapped text no matter what the row height, I'm open to suggestions. I've attached an example file Wrap_Example.xls.

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Excel cell size

by DKlippert In reply to Excel cell size

Select the range and then try this macro:
Sub Hundred()

For Each RW In Worksheets("Sheet1").Rows
If RW.RowHeight >= 100 Then
RW.RowHeight = 100
End If
Next RW

End Sub

Collapse -

Excel cell size

by kelley.hecke In reply to Excel cell size

The question was auto-closed by TechRepublic

Collapse -

Excel cell size

by RichTee In reply to Excel cell size

Answer #1 covers the total worksheet. You can use the following code if you want some control over what area you want the code to cover. You can also build from this code to make additional conditions.

Sub MaxRowHeight()
'the following will set the row height for the first 200 rows to
'a maximum of 100. Any row height under 100 stays as is.
'you can modify counter to fit your needs

Dim i As Integer
For i = 1 To 200

Rows(i).Select
If Rows(i).RowHeight > 100 Then
Rows(i).RowHeight = 100
End If
Next i

Range("A1").Select
End Sub

You should be well on your way.
Rich

Collapse -

Excel cell size

by kelley.hecke In reply to Excel cell size

The question was auto-closed by TechRepublic

Collapse -

Excel cell size

by kelley.hecke In reply to Excel cell size

This question was auto closed due to inactivity

Back to Software Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums