When declaring variables in VBA, you also assign a data type. But there is a trick to it: you want to choose a data type that uses the least amount of memory. In the VB Editor, which is found in the VBA help menu, I found a great chart of the data types, including what they are used for and how much memory they use.
You are browsing the VBA category:
Have you ever wanted to attach a Macro to a button on the toolbar in Microsoft Word? Maybe you have and have seen the images that are provided for you. Microsoft provides you with about 20 icons. I personnaly like the little pig icon:. But, how do we get rid of that little piggy and insert our own custom icon? Just follow these steps: Read the rest of this entry »
What is a variable?
Think of it this way, a variable is like a little box in your computer’s memory. The little box, the variable, will have a name. You store things in variables, like Dates, Strings, or Objects. At some point, you will retrieve the contents of the variable and do something with it. For example, you might display the Date that is being stored. You retrieve the contents of the variable by calling it by its name. You can name your variables pretty much whatever you want, but there are some rules and conventions to variable naming in VBA. Read the rest of this entry »
You have probably opened the VB Editor in Access, Word, or PowerPoint, and seen Option Explicit at the top of the code window. But what does it mean? Read the rest of this entry »