Hi all,
Placed in VBA as I'm coding it in VBA, though technically this question could probably be applicable to any if statement in any language.
I currently have an if statement that goes like:
I've always wondered if there's a way to not have the statement have to technically evaluate twice, I've not actually seen anything around google (or don't know what to search for).Please Login or Register to view this content.
If the value is not 0, use that already calculated value but if it's zero print "zero".
Essentially I'm looking for
Please Login or Register to view this content.
It gets pretty bad if for example I have nested if statements or a row of if statements all doing the same thing and the code becomes bloated with what appears to be redundancy.
Thanks.
Bookmarks