Else:

B

Bob

I just took over an excel spreadsheet from a guy who got
fired. In one of his macros he is using a series of
nested if statements and at the end of his if he puts
Else: and then ends the if with an EndIf. Is this Else:
statement necessary? Does the colon indicate an end of
executables under the else?
 
L

Lawson

in most cases, else is only necessary if its possible for
there to be an else. if ther is, and the program comes
across it, the program will jsut end - no problems

hope that helps!

ps: was it necessary to tell everyone about the firing of
a coworker? haha
 
L

larryN

The colon after the Else allows statements to be on one
line.

If <something here> Then <do this> Else:End If

The Else above is not necessary.


If <something here> Then <do this> Else: <do this> End If

Keep the Else in the statement above
 
B

Bob

Thanks! That's what I thought but I justed wanted to make
sure and no one here had seen that syntax before. Thanks
again!
 
Top