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


Reply With Quote