The document is a midterm exam for a course on Visual Basic for Applications (VBA). It consists of 5 questions that require students to write VBA code to create user-defined functions and macros. The functions include calculating minimum values, sums of odd numbers, reversing numbers, and validating Vietnamese phone numbers. Students are instructed to submit their exam in a macro-enabled Excel file before the deadline.
The document is a midterm exam for a course on Visual Basic for Applications (VBA). It consists of 5 questions that require students to write VBA code to create user-defined functions and macros. The functions include calculating minimum values, sums of odd numbers, reversing numbers, and validating Vietnamese phone numbers. Students are instructed to submit their exam in a macro-enabled Excel file before the deadline.
The document is a midterm exam for a course on Visual Basic for Applications (VBA). It consists of 5 questions that require students to write VBA code to create user-defined functions and macros. The functions include calculating minimum values, sums of odd numbers, reversing numbers, and validating Vietnamese phone numbers. Students are instructed to submit their exam in a macro-enabled Excel file before the deadline.
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