Thread: find a value
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
KL KL is offline
external usenet poster
 
Posts: 201
Default find a value

Hi Shawn,

Try this:

Sub test()
Dim x As Boolean
With Application
x = (.CountIf(Sheets("Sheet1").Range("A1:A58"), 999) _
+ .CountIf(Sheets("Sheet1").Range("A72:A89"), 999)) 1
End With
Sheets("Sheet1").Range("B1").Value = x
End Sub

Regards,
KL

"Shawn" wrote in message
...
I need a code that will search Sheet1.column A from A1:A58 and A72:A89 and
return in cell B1 the text "true" if the number "999" is found in the
target
range one or more times.


--
Thanks
Shawn