In: Computer Science
Do your best to write a formula that will automatically calculate total price for any amount of units placed in C12. | |||
Unit Quantity | Price per unit | ||
Below 5 | 36 | ||
5 to 10 | 34 | ||
11 to 30 | 31 | ||
31 to 50 | 26 | ||
51 above | 20 | ||
# of Units | |||
Total Price | (your formula here) |
Sheet 4 - |
Write a VBA function that changes the cell value of E3. Create a button on sheet 4 to increase the value by 1. Name this button "Higher". Then create a button below it that will decrease the number by 1 and name it "Lower". Save the function so we can review it. The value of E3 is 40 |
Solution
---
Write a VBA function that changes the cell value of E3. Create a button on sheet 4 to increase the value by 1. Name this button "Higher". Then create a button below it that will decrease the number by 1 and name it "Lower". Save the function so we can review it.
The value of E3 is 40
go to sheet4
Create two buttons "Higher" and "Lower"
for creating buttons
go to developers tab
and click Insert
select
Now select properties
in the properties
go to caption and change the name to Higher
Now double click on Button "Higher"
and write the following VBA code
Code
Private Sub CommandButton1_Click()
Range("E3").Value = Range("E3").Value + 1
End Sub
Screenshot
now click the Button Higher value will be increased by 1
--
same procedure do it for "Lower"
code
Private Sub CommandButton2_Click()
Range("E3").Value = Range("E3").Value - 1
End Sub
--
if you have any doubt, please mention it
love to help
all the best
please upvote