Tyreano.com

The inventions you need.

Legal Law

VBA – What is it and should you learn it?

Intermediate or advanced Office users may be wondering “what’s next?” having mastered many of the more complex tools in most applications. Visual Basic is something that many people have heard of, but are not sure what exactly it is or if it is relevant to them. VBA is a programming language, so if you are simply looking to gain more knowledge of Office without directly modifying it with your own macros or additions to the applications, it may not be for you.

VBA is understandably a derivative of Visual Basic, which you can code independently, whereas VBA can be used within a “host” application (ie most MS Office packages, especially Word and Excel). More advanced users will recognize the use of VBA in existing applications such as Microsoft Visio, and Visual Basic is used in some non-Microsoft products, such as AutoCAD and WordPerfect. Some Office applications have their own simple programming languages, for example, WordBasic for MS Word. However, you can do a lot more with VBA – it works great within standard Office applications.

Think of each Office application as a template that you can modify and you can begin to understand how to use VBA. Applications are divided into objects; for example, the menu bar in Excel is an object, just like the header and footer function in Word. Each object has properties that you can alter, from a small level (italicize a sentence), to a large level: edit menu bar selections to your liking. All VBA does, in essence, is allow you to change the properties of such objects, perhaps where existing functions don’t attack in the way you need. For example, if you frequently use the Verdana font in 36 point bold text, because it is the corporate “look” you use in your stationery, you can program a hotkey to immediately give the object (the text) the properties ( bold, size, etc) you want, without having to go through the different menu items individually.

Here is another example on how you can use VBA. Excel has a “day of the week” function that will return each day of the week as a number (1 for Sunday, or Monday if you prefer, 2 for Tuesday, and so on). However, it might be more useful (especially when sharing your workbook) to display the names of the days, in case others don’t understand the numbers that refer to the days. There is no function to do this, so you need a user-defined, or UDF, which you can program yourself in VBA. It’s not immediately obvious how you would use VBA, but in reality, all Office programs already have a built-in VBA editor.

If you think that someone, somewhere, would have already thought of an answer to the VBA problem you have (and need some code), you would be right! There are literally thousands of sites with code snippets, user-defined functions, macros, and other helpful bits and pieces to get you started with VBA. If you get more experience you might think about adding something yourself, if you think you have found the best fit in the office to make it work best. If it is useful and effective, share it!

LEAVE A RESPONSE

Your email address will not be published. Required fields are marked *