Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default 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
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
XL2002 - Worksheet_Activate Question... Trevor Williams Excel Programming 3 February 7th 08 09:01 AM
SelectionChange Alex McDermott Excel Programming 1 May 3rd 07 03:54 PM
SelectionChange event Hayeso Excel Programming 2 July 1st 05 03:07 PM
SelectionChange Event Squid[_3_] Excel Programming 5 February 11th 04 01:57 PM
SelectionChange - What am I doing wrong? Doug[_9_] Excel Programming 4 January 2nd 04 02:46 AM


All times are GMT +1. The time now is 04:15 PM.

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"