View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
isabelle isabelle is offline
external usenet poster
 
Posts: 587
Default If statement checking list

hi,

=IF(COUNTIF(B:B,A1)0,TRUE,FALSE)



Sub Macro1()
v = Range("A1") ' adapt cell value
If Application.CountIf(Range("B:B"), v) 0 Then ' adapt column
MsgBox True
Else
MsgBox False
End If
End Sub



--
isabelle



Le 2012-01-19 12:35, B Rucks a écrit :
Is there a way to use an If statement to see if a cell value is equal to
any value in the list and return a "yes" if true or "no" if false? The
list is in the same worksheet.