Step-by-step guidance to insert the button, provide the VBA code and enable the Macro. This is the complete assignment, you only need to reperform in the Excel provided by the lecturer.
Age Rebate
Primary rebate All 17 235
Secondary rebate 65 9 444
Tertiary rebate 75 3 145
To create a button that requests the employee's salary and age, and then calculates the tax payable
based on the provided tax tables, you can follow these steps:
1. Open the Excel file containing the tax tables.
2. Go to the "Taxtables" worksheet.
3. Click on the "Developer" tab in the Excel ribbon. If you don't see the "Developer" tab, you may
need to enable it in Excel options.
4. Click on "Insert" in the "Controls" group, and then click on "Button (Form Control)".
5. Draw the button on the worksheet where you want it to appear.
6. Right-click on the button and choose "Edit Text" to give it a meaningful label like "Calculate Tax".
7. Right-click on the button again and select "Assign Macro".
8. Click on "New" to create a new macro.
9. In the Visual Basic for Applications (VBA) editor window that opens, paste the following code:
Sub CalculateTax()
Dim salary As Double
Dim age As Integer
Dim tax As Double
Dim primaryRebate As Double
Dim secondaryRebate As Double
Dim tertiaryRebate As Double
' Get salary and age from user
salary = InputBox("Enter the employee's salary:", "Salary Input")
age = InputBox("Enter the employee's age:", "Age Input")
' Calculate tax
If salary < 512801 Then
tax = 0
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through EFT, credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying this summary from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller glenbezuidenhout. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy this summary for R55,00. You're not tied to anything after your purchase.