B
blueshot
Hi,
I am VERY new to VBA (second day) and am trying to create code tha
will take a value and check to see if it is contained within
specified list or not, returning "duplicate" if it is and "not
duplicate" if it is.
I don't think that the =Match formula is a defined function in VBA s
it is causing an error. How can I get around this? I would like t
create this function with coding that I know so would like to keep i
similar to what I have below
Function JDuplicate(Potential_Duplcate As Double, Look_In_Range A
range) As String
'if the cell is empty the return a blank
If Potential_Duplicate = "" Then
JDuplicate = ""
Else
' Check to see if the value is contained in the specified list
If isserror(Match(Potential_Duplicate, Look_In_Range, 0)
True) Then
JDuplicate = "not a duplicate"
Else
JDuplicate = "duplicate"
End If
End If
End Function
Can anyone help me without making my solution too complex. I am sur
that there is an easier way to code it and I am open to thos
suggestions to but I would really like to find the solution I a
looking for as well.
Thanks
I am VERY new to VBA (second day) and am trying to create code tha
will take a value and check to see if it is contained within
specified list or not, returning "duplicate" if it is and "not
duplicate" if it is.
I don't think that the =Match formula is a defined function in VBA s
it is causing an error. How can I get around this? I would like t
create this function with coding that I know so would like to keep i
similar to what I have below
Function JDuplicate(Potential_Duplcate As Double, Look_In_Range A
range) As String
'if the cell is empty the return a blank
If Potential_Duplicate = "" Then
JDuplicate = ""
Else
' Check to see if the value is contained in the specified list
If isserror(Match(Potential_Duplicate, Look_In_Range, 0)
True) Then
JDuplicate = "not a duplicate"
Else
JDuplicate = "duplicate"
End If
End If
End Function
Can anyone help me without making my solution too complex. I am sur
that there is an easier way to code it and I am open to thos
suggestions to but I would really like to find the solution I a
looking for as well.
Thanks