Monday, May 4, 2009

Adding a VBA Command Button

Adding a Visual Basic Command Button

We brought our 401K Calculator worksheet to a conclusion by using an ActiveX Command Button. We wrote code in our Visual Basic Editor to function whenever the Button is clicked to automatically execute the steps needed to Clear Data, and then request new information from the user to add data in our Retirement Calculator.

That should give you a small taste of what you can accomplish using VBA with Forms and ActiveX Controls.

If you find this sample interesting, then feel free to complete the last part of the chapter on VBA (Visual Basic for Applications) by constructing a User Interface to entirely automate the worksheet. You'll be surprised by how much can be controlled by getting an understanding of the capabilities of using VBA. Look over and optionally complete pages 567-603.