Sponsored Link

Sponsored Link

Tuesday, December 16, 2008

Understanding Visual Basic Editor in MS Excel

There are three main components that one should understand about Visual Basic Editor in MS Excel viz., Project Explorer, Properties and code window. All the version of MS Excel has same shortcut keys Alt + F11 key to bring up Visual Basic Editor in MS Excel. The picture shown below is Visual Basic Editor.

Click here to view enlarge

Microsoft Excel, VBE

Standard toolbar

Like any other Microsoft tool it comes along with ribbon toolbars. Shown below in the picture is standard toolbar which help you in performing various functions like run code, pause code and stop code which we will learn in details.

Click here to view enlarge

standard toolbar

Properties Window
Each object used in MS Excel has certain properties. These properties can be viewed in Properties window. We shall use these properties in examples ahead. In the picture below the properties window is showing the properties of sheet1. In case if you don’t find the properties window in VBE than press F4 key. F4 is shortcut key for bringing up Properties Window.

Properties are like the way you want the object to behave. Sometimes propertries are change on the runtime(While code is running). However, you can change all the properties at runtime

Click here to view enlarge

properties window

Project Explorer
Project Explorer shows all the Sheets, modules and classes presents in the project. Used of Project Explorer will be shown in the next post.

Click here to view enlarge

Microsoft Excel, Project Explorer

Code Window

Code windows is where you write your macro/VBA code. Code window has two drop downs one with the list of object as per the container selected in the project explorer. Like if Sheet1 is selected in the project explorer than you will find worksheet in left handside drop down. If the ThisWorkbook is selected then you will find Work in the left handside drop down. Similarly, you will find possible events listed in right handside drop down. For workbook you will find events like open, Window activate, Window deactivate etc. For worksheet, you will find events like SelectionChange etc

Click here to view enlarge

code window


Also, to add more to your knowledge about VBE. Visit following website : http://office.microsoft.com/en-us/help/HA010429591033.aspx

Feel free to comments about this post.  Also, you can receive free e-books, Add-ins, updates. Click here to Subscribe

We assure you knowledge, not SPAM!


Post a Comment