Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Displaying Data in a List

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Displaying Data in a List

Ricky,

Right click your sheet tab, view code and paste the code below in and try
selecting these wrapped cells

Dim myrow As Long
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
Rows(myrow).EntireRow.RowHeight = 12.75
Target.EntireRow.AutoFit
myrow = Target.Row
End Sub

Mike

"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

  #3   Report Post  
Posted to microsoft.public.excel.programming
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Displaying Data in a List

Thanks so much Per and Mike, exactly what I was after!

Ricky
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying a list of values MFK Excel Discussion (Misc queries) 2 September 26th 08 08:56 PM
Displaying duplicate recrords from a Data List Craig Excel Discussion (Misc queries) 1 August 2nd 08 09:26 PM
BUG? : data validation in-cell drop down list is not displaying Patachoup Excel Discussion (Misc queries) 9 May 17th 07 07:51 AM
Get rid of empty cells when displaying Data validation list mbeauchamp Excel Discussion (Misc queries) 6 October 5th 06 09:37 PM
How to reference list using a drop down menu, displaying the list eddiespaghetti Excel Programming 0 January 4th 06 08:08 PM


All times are GMT +1. The time now is 06:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"