View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default code doesnt work

This should work


Private Sub Worksheet_Change(ByVal Target As Range)
Dim ans
If Target.Address = "$P$2" Then
If WorksheetFunction.CountIf(Worksheets("Tracking"). _
Range("C4:C100"), Range("P2").Value) 0 Then
ans = MsgBox("Continue", vbYesNo)
If ans = vbYes Then SortTracker
End If
End If

End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"choice" wrote in message
...
when i type a number into sale!p2 and hit enter, i want it to check to see

if that number is in tracking!C4:C1000. if its not then i want the message
to come up