Excel Visual Basic Variables, Part 2: Declaring and Naming Variables, Scope and Lifetime
Subscribe to continue reading
Subscribe to get access to the rest of this post and other subscriber-only content.
Subscribe to get access to the rest of this post and other subscriber-only content.
In an earlier post, we recorded two Excel macros in Visual Basic, and ran them. Then, in the next post, we viewed the code in the Excel Visual Basic Editor. Code you have recorded will usually run. However, you may want to change it for all sorts of reasons. To tidy it up, make it…
The macros you recorded in the previous post are stored in an Excel file. To edit it you use what looks like a separate program, the Visual Basic Editor. Open it with the Developer ribbon (Code group) > Visual Basic Editor (Alt+F11). You will find newly-recorded macros under Modules in the explorer on the left…
Before Excel 2003, you could get a complete list of Visual Basic Functions by looking in Visual Basic Help > Contents > Functions. In Excel 2010, entering “Functions” into the Help Search box produces nothing useful. Using a specific category, e.g. “Math Functions”, may be more productive. Please be aware of what references to “Excel…
The Manning formula for open-channel flow is: whereV= Velocityn = Manning’s “n”,r = Hydraulic radius = area / wetted perimeter = b*y / (2*y + b) for a rectangular channel (where y = depth and b = width), ands = slope of channel (m/m). Discharge Q = V*A = V*b*y. We cannot solve this…
This is an excerpt from Microsoft Excel 2000 Visual Basic Help. 1. Objects and Collections An object represents an element of an application, such as a worksheet, a cell, a chart, a form, or a report. In Visual Basic code, you must first identify an object. Only then can you apply one of the object’s…