[RESOLVED] Collate common values
I have hundreds of variables and need to see if they are duplicated.
Is there a simple function I can use to achieve this rather than repeating the code for each? The variables have different types. Can you pass a variable name into a subroutine?
Code:
Sub CheckDuplicate(ByRef Variable As Object, ByVal value As Object)
'see if it is already duplicated
If Variable <> "Varies" Then
'if not see if it exists and a duplicate
If Variable <> value Then
'if not then add it
Variable = value
Else
'if it is a duplicate then return varies
Variable = "Varies"
End If
End If
End Sub
Re: Collate common values
What I had looks like it works. I put it together as a fuzzy example of what I was trying to achieve.
I just needed to check the types of variables and return a Varying result accordingly.
If TypeOf Variable Is String Then
Sorry.