Hi guys,
I have a function like this
Function newor(num, num1, num2, num3)
Application.Volatile
num1 = Range("Sheet1!B1").Value
If (num = num1 Or num = num2 Or num = num3) Then
newor = True
Else
newor = False
End If
End Function
This function works wells when i type =newor(1,2,5,6). It will compare value of B1 cell to 2,5,6. If one of these number match B1 value, newor = true. But when i type =newor(1,2,5) the result is #VALUE!. So how to make it run with changeable number of input variable.
Ex:
=newor(1,2,4) Compare B1 cell with 2 and 4. If there is one match --->True
=newor(1,2,4,6,9) Compare B1 cell with 2,4,6,9. If there is one match --->True
=newor(1,2,4,7,10,11) Compare B1 cell with 2,4,7,10,11 . If there is one match --->True
Thank you very much.
I have a function like this
Function newor(num, num1, num2, num3)
Application.Volatile
num1 = Range("Sheet1!B1").Value
If (num = num1 Or num = num2 Or num = num3) Then
newor = True
Else
newor = False
End If
End Function
This function works wells when i type =newor(1,2,5,6). It will compare value of B1 cell to 2,5,6. If one of these number match B1 value, newor = true. But when i type =newor(1,2,5) the result is #VALUE!. So how to make it run with changeable number of input variable.
Ex:
=newor(1,2,4) Compare B1 cell with 2 and 4. If there is one match --->True
=newor(1,2,4,6,9) Compare B1 cell with 2,4,6,9. If there is one match --->True
=newor(1,2,4,7,10,11) Compare B1 cell with 2,4,7,10,11 . If there is one match --->True
Thank you very much.