nested elseif statements
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Nested 'ElseIf' statements

Nested 'ElseIf' statements

resolvedResolved · Low Priority · Version 2003

replyReply Thu 10 Mar 2011, 11:29Delegate Graeme said...

Graeme has attended:
Excel VBA Intro Intermediate course

Nested 'ElseIf' statements

Can you please advise if there is a limit to the number of 'ElseIf' statements you can nest into a single 'If' > 'End If'?

For upcoming training course dates see: Pricing & availability

replyReply Tue 15 Mar 2011, 10:46Trainer Stephen said...

RE: Nested 'ElseIf' statements

Hi Graeme

Thanks for your question

In principle there is no limit to the number of ELSEif in an if block. I would however recommend using a Select Case block for checking a large number of multiple conditions, as this is easier to maintain and understand

Regards

Stephen

 

Please browse our web site to find out more about
basic training excel and other Microsoft training courses.

Excel tip:

Bracketed negative numbers

Often Excel users wish to display negative numbers in colour red and bracketed

Intstructions
Step1. Select Format > Cells menu options. Within Numbers tabsheet, select Category = Custom.
Step 2. Select a type such as #,##0;[Red]-#,##0;; that specifies a colour in square brackets.
Step 3. Amend as follows; #,##0;[Red](#,##0;;

Notes: Excel formatting featues are of the form
"Positive; Negative;Zero;Text" separated by semicolon.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard