XL2002 - SelectionChange Question...

  • Thread starter Thread starter Trevor Williams
  • Start date Start date
T

Trevor Williams

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
 
Try just deleting the selection
Private Sub Worksheet_SelectionChange(ByVal Target As Range
to
Private Sub Worksheet_Change(ByVal Target As Range
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top