I'm working on implementing a fuzzy-matching function in VBA for a project I'm working on. Ideally, I'd like it to be iterable, since that way I don't have to deal with the headache of holding its output in a variable that I have to constantly ReDim.
However, when I modify the function's declaration in accordance with the docs, Excel's IDE marks the Iterator Function line red, which I believe means there's some sort of error (although it won't tell me what the error is):
Iterator Function FindFuzzy(sInp as String) as System.Collections.Generic.IEnumerable(Of String)
Dim toreturn(40) As String
Dim i As Long, j As Long, matches As Long, cell As Range, legngthError As Long, charsFound As Long, C ...
Dim index as Integer
When I try running the macro anyway, it errors out the moment I get to the For Each loop, throwing the compile error "Sub or Function not defined".
What am I doing wrong here?
For reference, here is the function declaration without the iteration syntax:
Function FindFuzy(sInp as String) As String()
Dim toreturn(40) As String