Professional Documents
Culture Documents
Objectives
Scenario:
John Barrett of Books Treasure, Inc. needs to present the
sales report for the month using the standard format. He has to
work on a large number of worksheets to create the
consolidated report. Here are the specifications to format the
sales report:
The current date should always appear at the top left corner of the
worksheet.
The column headings should appear in bold and blue in color.
The name of the organization should be center aligned, red in
color, bold, and underlined. Also, the font size should be 20 points.
The data in the cells should be green in color and appear in italics.
Also, the font size should be 10 points.
Solution:
To solve the preceding scenario, you need to create a macro
to automate the task of formatting the report.
Scenario:
Tom Wilkins of Books Treasure Inc., has suggested some
changes in the specifications to format the sales report. Here
are the new specifications:
The column headings should appear in bold and red in color.
The data in the cells should be green in color and appear in italics.
Also, the font size should be 12 points.
Solution:
To solve the preceding scenario, you need to edit the macro
and customize it to the new specifications.
Scenario:
John Barrett wants to customize the worksheet so that he is
able to see the total sales in rupees and dollars. He also wants
to display the category-wise total sales.
Solution:
To solve the preceding scenario, John need to perform the
following:
Add two option buttons inside a frame control for rupees and
dollars. (By default total sales should be displayed in dollars)
Add a command button and attach it to a macro that calculates the
category-wise sales.
Scenario:
Books Treasure, Inc. has decided to offer home loans to their
employees. All the permanent employees will be eligible for the
loan. Any employee who applies for the loan has to fill up a
Home loan form.
Solution:
To solve the preceding problem, you need to create Home loan
form. The form should be appealing, easy to use, and should
consist of the following fields:
Employee ID
Employee Name
Date of Birth - with date, month, and year fields
Basic Salary – range provided
Date of Joining - with date, month, and year fields
Marital Status - options available for selection
Preferred Installment Period – multiple options defined with
preference criteria
If...Then...Else Statements:
It helps in the execution of the code based on a condition. In
case of multiple conditions, there must be a matching End If for
each If.
Select Case Statements:
It is used when a variable assumes multiple values and you
have to respond differently depending on the values stored.
Do…Loop Statement:
It causes a part of the program to be repeated for a specified
number of times, while the condition specified remains true.
For…Next Statement:
It allows you to loop through a set of statements for a definite
number of times.
Scenario:
Books Treasure, Inc. is offering home loans to their
employees. All the permanent employees are eligible for the
loan. Any employee who applies for the loan should fill up a
form, which would calculate the amount of loan for which the
employee is eligible.
Solution:
Create an event for the “Calculate Loan” command button in
the home loan form.
At the click of this button, the amount of loan for which the
employee is eligible should be displayed.
Add a close button to the form to close the application.