shivahsingh
New Member
- Joined
- Oct 1, 2014
- Messages
- 10
This assignment requires you to create 2 macros in one module. Create one global constant and one global variable as follows which are to be used in both macros.
a constant named as “tax” of type double to store tax percentage
a variable named as “totalSales” of type currency
Part 1
You’re to write a macro named as “calculateTotalSales1” to calculate the total sales of four items in your shopping basket. You’ll need to create only one variable named as price of type currency which will be local to this macro. You’re asked to use the variable price four times to get the price for each of the four items in the grocery basket, and make sure you’re adding the price of an item to the totalSales before ask user to enter the price for the next item. Eventually you will be calculating the following:
totalsales= sumofprices+tax/100*sumofprices
I've declared my variables and constant, still confused on how to set the constant as a percentage
and how to use the price variable to create a function,
how do i refer to the cells as prices
please help this is my first class and first time dealing with vba
the sales numbers are in cells e2:e5
a constant named as “tax” of type double to store tax percentage
a variable named as “totalSales” of type currency
Part 1
You’re to write a macro named as “calculateTotalSales1” to calculate the total sales of four items in your shopping basket. You’ll need to create only one variable named as price of type currency which will be local to this macro. You’re asked to use the variable price four times to get the price for each of the four items in the grocery basket, and make sure you’re adding the price of an item to the totalSales before ask user to enter the price for the next item. Eventually you will be calculating the following:
totalsales= sumofprices+tax/100*sumofprices
I've declared my variables and constant, still confused on how to set the constant as a percentage
and how to use the price variable to create a function,
how do i refer to the cells as prices
please help this is my first class and first time dealing with vba
the sales numbers are in cells e2:e5