View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default worksheet change event?

Not too clear on what you need, but here is some change event code as an
example

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:H10")) Is Nothing Then
With Target
'do your stuff
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Steph" wrote in message
...
Good afternoon. On Sheet2 of my workbook, I have a table that drives a

data
validation list on sheet1. Sheet2 Col A has the status of Open or Closed.
Col B has the validation item list. So on sheet1, the list is only
populated with the Open items.

What I am trying to do is this - if the status of an item on sheet2 is
changed to Closed (and therefore removed from the validation list), how

can
I find that item on Sheet1 and delete it in every cell that it occurs in?

I
have heard of a worksheet change event, but not familiar with coding it.
Thank you in advance.