Write the VBA code for the following questions. Save your answers as an Excel Macro-Enabled Workbook with
Question:
Write the VBA code for the following questions. Save your answers as an Excel Macro-Enabled Workbook with your name and ID (e.g. ahmad_alahmad_123456.xlsm). Please save your questions as different subs (e.g. Sub question1()). Upload your response to Moodle, through the Assignment link. Please notes that it is the students’ responsibility to save and upload their files properly. If your file cannot be viewed, or if you fail to upload or send your file on time, your grade will bezero.
Question 1:
Write VBA code for a program that accepts four values for Customer ID, Customer name, year of birth, and age from the user.
Set the value of Customer Id in cell A1 at the active sheet in the active workbook.
- Set the value of the Customer name in cell B1 at the active sheet in the active workbook.
- Set the value of a year of birth in cell C1 at the active sheet in the active workbook.
- Set the value of age in cell D1 at the active sheet in the active workbook.
- Make test in the range A1 to D1 to be red if the age is not correct, and green if the age is correct.
(age = 2021 - year of birth).
- Question 2:
Write VBA code for a program that reads two numbers from range A5 to B5 and displays the appropriate one of the following messages:
a. A5 < A5 value > is smaller than the B5
b. A5 < A5 value > is larger than the B5
c. Numbers are equal.
Question 3:
Write VBA code for a program for a gym subscription plan. Allow user to enter a number of months and the plan price. Assume that the user earns an extra five percent discount every month. The program output is a schedule that lists each month number in the gym subscription plan starting with month 1 and the user’s savings at that month.
Example:
The user entered 3 months gym subscription for the 120 KD plan.
The output:
- Month number 1 the discount percentage is 0% and the discount amount is 0KD
- Month number 2 the discount percentage is 5% and the discount amount is 6KD
- Month number 3 the discount percentage is 10% and the discount amount is 12kd
Integrated Accounting
ISBN: 978-1285462721
8th edition
Authors: Dale A. Klooster, Warren Allen, Glenn Owen