Excel Vba Check If Key Is In Collection

[Solved] Excel Vba Check If Key Is In Collection | Vb - Code Explorer | yomemimo.com
Question : excel vba check if key is in collection

Answered by : daniel-ferry

'A Dictionary is a better choice when you need to determine if a key
'is already in the collection. But here is a VBA function that
'reports True or False for Collections:
Function KeyExists(key$, c As Collection) On Error Resume Next c.Item key KeyExists = Err = 0: Err.Clear
End Function
'--------------------------------------------------------------------
MsgBox KeyExists("Netflix", colFANG)

Source : http://academy.excelhero.com/ | Last Update : Wed, 06 May 20

Answers related to excel vba check if key is in collection

Code Explorer Popular Question For Vb