I am writing a VBA code which looks as follows:
If function_one Or Function_two Or Function_three Then
' Do Something
End If
So, if any one of the functions return true value, it will do something.
I thought, I have written a small, and efficient code.
But during debugging I found, VBA runs function_one, gets its return value, then runs function_two, gets its return value, and so on for third and then evaluates if condition and proceeds further.
What I want to achieve is, as soon as first function returns true it should do something, and should not execute other functions. If first function fails then only next function should be called.
Later on, I used loop keywords to achieve this task, but it doesn't looks simple/smart. So do you know, how I could write, same code in more optimized way.