View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Change_Event target either of two cells

Note that the "If Target.Count..." line really isn't needed since the
select case criteria are single cells...

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("B5,J5")) Is Nothing Then Exit Sub
Application.EnableEvents = False
On Error Resume Next
Select Case Target.Address
Case "$B$5": Scan_In_Check
Case "$J$5": Scan_Out_Check
End Select
Application.EnableEvents = True
End Sub

...and so will not match if a range of cells are changed.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion