Excel Visual Basic Variables, Part 1: Variable Types
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.
This is from Microsoft Excel 2000 Visual Basic Help, with changes and additions. All arguments are passed to procedures by reference, unless you specify otherwise. This is efficient because all arguments passed by reference take the same amount of time to pass and the same amount of space (4 bytes) within a procedure regardless of…
1. What are Controls? First, some terminology. If you wanted to run a macro from a worksheet, you could create a button on the worksheet for the user to click. Such a button is a Control. There are many types of controls, which we will use in a later post. Apart from Command Buttons to…
1. The Application Keyword Use “Application” to refer to Excel, e.g.: Application.ActivePrinter Name of the Active Printer.Application.Name Name of the program running (“Microsoft Excel”).Application.Path The path from which the program is running. 2. ActiveControl Instead of the name of a specific control (e.g. txtEdit), you can use the keyword ActiveControl. This will let your program refer…
A Macro is a computer program that can duplicate actions you take in a spreadsheet. Macros perform key tasks faster. They can have a short-cut key combination to run them easily. Creating Excel and Word Macros is easier than most other methods of programming. You simply record the actions you took in the program. You…
Windows stores program settings in the Registry, a Windows internal database. You can use this to remember previous user choices and use them as defaults the next time. We typically remember window positions, file paths, and other settings with the Registry. These three commands work with items stored in the Registry: SaveSetting appname, section, key,…
This is from Microsoft Excel 2000 Visual Basic Help, with changes and additions. A Function procedure is a series of Visual Basic statements enclosed by the Function and End Function statements. A Function procedure is like a Sub procedure, but a function can also return a value. A Function procedure can take arguments, such as…