View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Trevor Williams Trevor Williams is offline
external usenet poster
 
Posts: 181
Default 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