View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
davidm davidm is offline
external usenet poster
 
Posts: 1
Default Validating in VBA


Correction: (as bolded)

Another way, via Worksheet_Change Event:

Assuming your list is in range *B1:B5* and your working range is
*D1:D20*

Private Sub Worksheet_Change(ByVal c As Excel.Range)
If Intersect(c, Range("d1:d20")) Is Nothing Then Exit Sub
If Not Range("b1:b5").Find(c) Is Nothing Then
c = c.Value
Else
c.ClearContents
End If
End Sub


--
davidm
------------------------------------------------------------------------
davidm's Profile: http://www.excelforum.com/member.php...o&userid=20645
View this thread: http://www.excelforum.com/showthread...hreadid=488147