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.
If the function you want to use exists in Excel VBA, use that. It will be faster and cleaner, and work in all Microsoft Office programs, not only in Excel. Here is a full list of Excel VBA Functions. If the function you want is not there, but exists in the Worksheet, you may be…
In Alice in Wonderland by Lewis Carroll, at the trial of the Knave of Hearts, the White Rabbit asks the King how to read the evidence. “Begin at the beginning, the King said, very gravely, and go on till you come to the end: then stop.” It would be easy if all computer programs did…
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 our previous post, we looked at the steps to record and run a macro. Practice makes perfect, or at least helps us improve, so let’s do an exercise. We will record a simple macro to format the current cell in bold, italics, and single-underscored. Then it will move one cell to the right, ready…
1. MsgBox MsgBox (Message Box) brings up a dialog box with a title bar, a message of our choice, and a choice of icons and buttons. The function can return a value that tells us which button the user clicked. We have seen MsgBox in passing in earlier posts. Here is the syntax of the…
You can use Excel Visual Basic to read and write text files (Sequential and Random file access). But we will not touch on text files in this post. Rather, we will look at how to save and open Excel files using Excel code, plus a few valuable functions: The bigger examples below are in the…