LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default what takes precedence between change and selectionchange?

Hi

i have a single sheet with these 2 events:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Private Sub Worksheet_Change(ByVal Target As Range)

Is there a particular order of execution between these two in excel?


Also how can I disable the selectionchange from executing if the user
deletes a value? When the value is deleted it puts it back

Thank you
Susan Hayes

Private Sub Worksheet_Change(ByVal Target As Range)

Dim mytime
mytime = Now
On Error GoTo ErrHandler
If Target.Column <= 26 Then
Application.EnableEvents = False
If mytime Range("O" & Target.Row).Value + 0.5 And Range("P"
& Target.Row).Value = 0 And _
Range("H" & Target.Row).Value = Range("S" & Target.Row).Value
Then
Range("C" & Target.Row).Value = "Historical"


End If

End If

ErrHandler:
Application.EnableEvents = True
End Sub
 
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
HOW DO I SET UP A PRECEDENCE DIAGRAM? G Heard Excel Worksheet Functions 1 May 30th 07 05:49 AM
Takes too long for Filedialog to change directory File selection in office2003 Excel Discussion (Misc queries) 1 May 1st 06 05:33 AM
VBA Precedence Problem Mike King Excel Programming 11 June 16th 05 10:13 PM
Remember SelectionChange range in the Change sheet event? Marie J-son[_5_] Excel Programming 2 January 30th 05 09:40 AM
optionbutton takes two clicks to change value Will Gardner Excel Programming 2 December 1st 04 03:00 PM


All times are GMT +1. The time now is 09:01 PM.

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

About Us

"It's about Microsoft Excel"