View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Spencer Spencer is offline
external usenet poster
 
Posts: 29
Default does range value exist in another range

i don't want to enter a formula in a cell, i want to return the value
true/false back to a variable called "VARIABLE". True being the value in B5
was found in column A, or False meaning it was not.

"merjet" wrote:

Sub Macro1()
Range("C5").FormulaR1C1 = _
"=MATCH(RC[-1], R[-4]C[-2]:R[5]C[-2],0)"
If IsNumeric(Range("C5").Value) Then
MsgBox "Found"
Else
MsgBox "Not found"
End If
End Sub

Hth,
Merjet