View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen[_2_] Per Jessen[_2_] is offline
external usenet poster
 
Posts: 703
Default Displaying Data in a List

Hi Ricky

Use SelectionChange event to pick up the active row and change row
height. If multiple rows are selected, only to first row in selection
will autofit.

As this is an event code it has to go into the code sheet for the
desired sheet:

Dim LastRow As Long
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If LastRow = 0 Then LastRow = 1
Rows(LastRow).RowHeight = 12.15
LastRow = Target.Row
Target.Rows(1).AutoFit
End Sub

Hopes this helps.

---
Per

On 13 Apr., 11:50, Ricky wrote:
I have a simple data list with the following headers for col A, B and C:
"FirstName", "LastName", "Comments".

The "Comments" column (C) has up to 80 words at times in the one cell
that is formatted "wrap text".

Is there a way to expand the row height from the default of 17 pixels to
reveal the complete text entry in the "Comments" cell automatically when
the cursor is on that row?

Ideally, once you move to the next row, the row above will then collapse
back to 17 pixels, and the new row height will expand (if necessay) to
reveal the complete text the "Comments" field/cell .

Any ideas would be appreciated.

Thanks - Ricky