You are on page 1of 2

THE JOINT BACHELOR PROGRAM IN APPLIED FINANCE

between University of Economics Ho Chi Minh City and University of Rennes 1

MIDTERM EXAM Sample


Semester: Spring 2023 Class: AF001
Course title: Visual Basic for Applications (VBA)
Exam date: 16 Feb 2023 Duration of exam: 120 minutes
Instructions:
- This is an open-book exam;
- Prepare the environment to code VBA script:
o Create an excel file, save as macro-enabled file extension; your file name
structure: StudentID – Your full name.xlsm
o Enable using macro and set trusted location to ensure that macros and
scripts will be run in your computer;
o Submit your macro-enabled file to LMS before deadline.
Questions
1. Create a user-defined function:
a. Input 3 parameters
b. Return the minimum value
c. Test your function in Excel Worksheet
2. Create a function to calculate the sum 1 + 3 + 5 + 7 + … + 99 (odd numbers
only)
3. Create a function to:
a. Input a number
b. Output the results in reverse order
Example: input: 12589 -> output: 98521
4. Design a workbook:
a. Keep only one sheet in your excel workbook
b. Assign a button to copy the current sheet into N copies, where N is
derived from the value in a specific cell.
c. Assign a button to delete all sheets except the first sheet.
5. Create a function to determine whether a text string is a Vietnamese Mobiphone
number.
Example: 0905553609 -> true
02858490393 or 090.555.3609 -> false

1/2
2/2

You might also like