View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_7_] Bob Phillips[_7_] is offline
external usenet poster
 
Posts: 1,120
Default Worksheet SelectionChange event

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

On Error Resume Next
If Not Intersect(Target, Range("job_no")) Is Nothing Then
Application.ScreenUpdating = False
Worksheets("summary").Calculate
'Call ...MyCode.....
Application.ScreenUpdating = True
End If

End Sub


--
HTH

Bob Phillips

wrote in message
ups.com...
Hi, I have the following bit of code attached to a worksheet object:


Private Sub Worksheet_SelectionChange(ByVal Target As Range)

On Error Resume Next
If Target = Range("job_no") Then
Application.ScreenUpdating = False
Worksheets("summary").Calculate
Call ...MyCode.....
Application.ScreenUpdating = True
End If

End Sub

This works fine when the cell called "job_no" is selected or changed,
however it also runs when some other cells, (but not all), containing
just text, no formulae, are also changed.

Can anyone suggest what may be happening. I only want it to run if the
"job_no" cell is changed/selected.

Usual TIA

Rgds