Statement too complex

Visual Basic is unable to analyze this statement. This error has the following causes and solutions:

  • Your statement can't be parsed due to its complexity. Try breaking the statement into several smaller components or replace complex conditional clauses with a combination of logical operators and If...Then...Else statements.

  • Your statement or function uses too many nested function calls. Make function calls earlier and assign the results to specific variables; then use the variables in the statement that is causing the complexity error.

For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.