View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Incidental Incidental is offline
external usenet poster
 
Posts: 226
Default Data Validation starts change event

Hi Kristen

The code below would be one way of doing what you want. It will take
the value entered in the changed cell and then search for that value
in a given range on sheet3, if the value is found it will show a
msgbox (replace this code with a call to your own macro) if not it
won't do anything.

Paste the code below into the module for the worksheet you are working
on.

Option Explicit
Dim FoundCell, MyRng As Range

Private Sub Worksheet_Change(ByVal Target As Range)

Set MyRng = Worksheets("Sheet3").[A1:A20]

Set FoundCell = Worksheets("Sheet3").Cells.Find _
(What:=Target.Value, LookAt:=xlWhole)

If Not FoundCell Is Nothing Then

MsgBox Target.Value & " was found in the list on sheet3"

End If

End Sub

Hope this helps

Steve