'Exit Function' is not valid in a Sub or Property
Exit Function appears in a Sub procedure or a Property procedure. An Exit statement must match the block in which it occurs.
Error ID: BC30067
To correct this error
- Replace the Exit Function with the Exit Sub or Exit Property statement as appropriate.