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.
We had an earlier post, How to Use Objects, Collections, Properties, Events and Methods in Excel Visual Basic. There, we introduced the idea of Objects and Collections. We listed the most useful Objects, and Collections of Objects. Below we have more extensive diagrams, specifically for the Excel Object Model. It helps to understand the hierarchy:…
In the Excel Visual Basic Editor (Alt+F11), display the Project Explorer (Ctrl+R). Usually (and in this picture), it appears at the top left, under the toolbars: In Project Explorer, you will see a VBAProject for every Excel file that is open. The list will include the hidden Personal Macro workbook, Personal.xlsb, if you have personal macros….
In this post, we will give you some more of the basic (forgive the pun) building blocks of the Visual Basic programming language. We will cover formulas, assigning values, logical comparison, constants, comments, and continuation lines. We conclude with two small examples. One of them demonstrates our first Error Trap. 1. Formulas We have already…
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,…
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…