Spanning Long Statements over Multiple Lines

Problem

Some of your code statements are very long and you'd like to make them more readable by splitting them over multiple lines.

Solution

Use the underscore character (_) to break statements over multiple lines, as shown in Example 2-10.

Example 2-10. Spanning multiple lines

k2(1) = dt * dy1dt(y(1) + k1(1) / 2#, y(2) + _
 k1(2) / 2#, y(3) + k1(3) / 2#, y(4) + _
 k1(4) / 2#)

You must include a space between the last character of a line and the underscore character.

Using Excel

Getting Acquainted with Visual Basic for Applications

Collecting and Cleaning Up Data

Charting

Statistical Analysis

Time Series Analysis

Mathematical Functions

Curve Fitting and Regression

Solving Equations

Numerical Integration and Differentiation

Solving Ordinary Differential Equations

Solving Partial Differential Equations

Performing Optimization Analyses in Excel

Introduction to Financial Calculations

Index



Excel Scientific and Engineering Cookbook
Excel Scientific and Engineering Cookbook (Cookbooks (OReilly))
ISBN: 0596008791
EAN: 2147483647
Year: N/A
Pages: 206
Authors: David M Bourg

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net