Else:

  • Thread starter Thread starter Bob
  • Start date Start date
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?
 
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
 
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
 
Thanks! That's what I thought but I justed wanted to make
sure and no one here had seen that syntax before. Thanks
again!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top