You are on page 1of 3

Page 1 of 3

DISC 112: LAB 9


10:00 AM – 11:50AM
FRIDAY, NOVEMBER 24, 2023

Follow the instructions in the given order to complete the assignment:


TOTAL MARKS = 25

PART 1: (1 MARK DEDUCTION IF NOT DONE RIGHT)


1. Create a new excel workbook and save in D Drive (as a macro enabled file .xlsm)
and name it after lab number and your roll number (e.g. L9-2026-11-001).
2. This is an individual assignment. Fill in the information by answering the first
question below.

PART 2: GROUP MEMBERS INFO (5 MARKS)


1. For the sake of this question, pretend that this is a group lab. Saving student/group
member’s information in the same format for each lab has gotten so boring. Let’s
automate it!
a. Insert a new worksheet named “Group” in the workbook. Record a macro
that inserts a box with the headings “Group Members”, “Roll Number”,
“Name”, borders and highlighting in cells A1:B6 (top of your worksheet). [3]
Your box should look like the following image:

Group Members
# Name Roll Number
1
2

b. Name the macro “Group_Information”. [.5]


c. Shortcut key should be Ctrl+Shift+G.
d. The macro should have the following description: [.5]
“This macro prints a formatted box to enter my group details.”
e. The macro should be able to print this given box on cells B2:D5 in your
workbook. [.5]
f. The last active cell must be A7. [.5]
g. Save the new macro.
h. Run the macro and enter your details in the resulting box.
Page 2 of 3

PART 3: INVENTORY SHEETS (20 MARKS)


1. Create a new worksheet “Quarter1-2021”, and record a macro that stores the following
headers in the top row of the worksheet: (The Macro should be using ‘absolute
referencing’)
a. Product ID, Product Name, Starting Quantity, Value of Starting Inventory,
Quantity Purchased, Cost of Purchases, Ending Value of Inventory, Cost of
Goods Sold. (The order of the headers/headings should be the same as
mentioned)
 Name the macro “InventorySheet_Headers_1” [.5]
 Add a shortcut key for the header such that the macro runs by pressing
Ctrl+Shift+D [.5]
 The recorded macro must have the following description: [.5]
 “This macro adds the headers as prescribed in Part 3-Question 1.”
 The headers of the worksheet should appear from cell A1 to H1 in order
given. [2]
 Format the headings to center aligned, shaded green, font white, font size
14, with borders. [1]
 After entering the worksheet headers, the active cell must be cell A2. [.5]

2. Create a new worksheet “Quarter2-2021”.


a. Create a second macro like questions 1 above but the Macro should be using
‘relative referencing’. Do the following:
 Name of the macro “InventorySheet_Headers_2”. [.5]
 Shortcut key Ctrl+Shift+E. [.5]
 The macro should have the following description: [.5]
 “This macro adds the headers for worksheet as prescribed in Part
3-Question 2.”
 All the headers/headings should start from your currently selected cell
wherever it be. [3]
 Format the headings to center aligned, shaded light orange, font black,
font size 14, with borders. [.5]
 Save the new macro.
 Create a worksheet “Quarter3-2021”, select cell B2 and run the macro
“InventorySheet_Headers_2” .
 Repeat the same for a newly created worksheet “Quarter4-2021” by
selecting cell D3. [2]
Page 3 of 3

3. Create a new worksheet ‘Quarter1-2022’. From 2022 onwards, the store manager decided
to enter the details of product description as well. The Macro should be using ‘relative
referencing’.
a. Create a third macro called “InventorySheet_Headers_3” similar to
‘InventorySheet_Headers_1’ but such that the “Product Description” header
appears immediately next to “Product Name”. [3]
b. The recorded macro must have the following description: [1]
“This macro adds headers as prescribed in Part 3-Question 3.”
c. There should be no shortcut key assigned.
d. Save the new macro.

4. Go to the worksheet “Quarter1-2022” select at cell B5 and followed by


‘InventorySheet_Headers_3’. Also repeat the same for worksheet “Quarter2-2022”
(select and run at cell J2). [2+2]

You might also like