An Excel/VBA application can be anything from a small routine that performs a useful service to a large application that completely shields the user from Excel s basic interface. Excel provides a variety of ways to launch an application that can be tailored to suit the system. The ways is which an Excel VBA program can be launched are as follows:
Invoking a macro with the Macro dialog box.
Auto_Open invoked whenever a workbook containing the macro is opened.Auto_Close invoked whenever the workbook containing the macro is closed.OnSheetActivate invoked when you first enter data on a worksheet.OnEntry invoked when you enter a worksheet.
The following example illustrates how the Auto_Open procedure can be used to provide a start up message.The example shown in the first listing will give a different message for each day of the week. On Monday the message given is Have a nice week , on Tuesday the message is One down, four to go! ,and so on. The procedure works by creating a variable that will contain the digits from 1 to 7 representing the days of the week. It then finds out what day it is, using a built-in function that returns the current day, and a Case statement to decide what to do for each day of the week. Don t worry about your understanding of this just yet, as long as you can see how Auto-Open() works. The line select Case dayNum is used to choose the current day and to associate the appropriate message so that it can then be output in a message box.
Listing Using the Auto_open macro
Sample MsgBox from
VBA For Excel Related Tutorials
|Microsoft Excel Tutorial||Microsoft Word Tutorial|
|Microsoft Powerpoint Tutorial||Microsoft Entity Framework Tutorial|
|Microsoft Azure Tutorial||Microsoft Project Tutorial|
|Advanced Excel Charts Tutorial||Advanced Excel Functions Tutorial|
|Excel Dashboards Tutorial||Excel Data Analysis Tutorial|
|Excel pivot tables Tutorial||Excel Power View Tutorial|
VBA For Excel Related Interview Questions
|VBA For Excel Interview Questions||Microsoft Excel Interview Questions|
|Microsoft Word Interview Questions||Microsoft Powerpoint Interview Questions|
|Microsoft Entity Framework Interview Questions||Microsoft Azure Interview Questions|
|Microsoft Project Interview Questions||Excel Data Analysis Interview Questions|
|Excel pivot tables Interview Questions||Excel Power View Interview Questions|
|Microsoft Interview Questions|
Vba For Excel Tutorial
Computers And Vba
Recorded Excel Macros
Introduction To Vba
Introduction To Objects
Decisions In Vba
Debugging And Testing
Subs And Functions
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.