Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
XL2002 - SelectionChange Question...
I need to trigger an 'autofit' event when the cursor 'exits' a cell, not
'enters' a cell. Here's the code I have so far Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Not Intersect(Target, Range("D8")) Is Nothing Then Range("D8").EntireRow.AutoFit End If End Sub So, basically, when a user enters text into, and then moves away from range D8 the autofit line is executed. Currently it executes when the cusrsor enters D8. Any help apreciated. Trevor Williams |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
XL2002 - SelectionChange Question...
Try just deleting the selection
Private Sub Worksheet_SelectionChange(ByVal Target As Range to Private Sub Worksheet_Change(ByVal Target As Range -- Don Guillett Microsoft MVP Excel SalesAid Software "Trevor Williams" wrote in message ... I need to trigger an 'autofit' event when the cursor 'exits' a cell, not 'enters' a cell. Here's the code I have so far Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Not Intersect(Target, Range("D8")) Is Nothing Then Range("D8").EntireRow.AutoFit End If End Sub So, basically, when a user enters text into, and then moves away from range D8 the autofit line is executed. Currently it executes when the cusrsor enters D8. Any help apreciated. Trevor Williams |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
XL2002 - SelectionChange Question...
Hmmm, that's slightly embarrassing! LOL.
Thanks Don, it's a big help. "Don Guillett" wrote: Try just deleting the selection Private Sub Worksheet_SelectionChange(ByVal Target As Range to Private Sub Worksheet_Change(ByVal Target As Range -- Don Guillett Microsoft MVP Excel SalesAid Software "Trevor Williams" wrote in message ... I need to trigger an 'autofit' event when the cursor 'exits' a cell, not 'enters' a cell. Here's the code I have so far Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Not Intersect(Target, Range("D8")) Is Nothing Then Range("D8").EntireRow.AutoFit End If End Sub So, basically, when a user enters text into, and then moves away from range D8 the autofit line is executed. Currently it executes when the cusrsor enters D8. Any help apreciated. Trevor Williams |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
XL2002 - Worksheet_Activate Question... | Excel Programming | |||
SelectionChange | Excel Programming | |||
SelectionChange event | Excel Programming | |||
SelectionChange Event | Excel Programming | |||
SelectionChange - What am I doing wrong? | Excel Programming |