In: Computer Science
Sally Artisan Bakery makes a variety of organic bread. The bakery is open every day from 7 AM to 6 PM. At 4 PM each day, the bakery marks down its goods by 25%. It also offers a 10% discount every Sunday before 10 AM. Design a spreadsheet that displays the current date/time in one cell. Have your spreadsheet display the correct amount due when the user enters a sale amount, assuming no taxes will be charged. |
Final output would be like this
Dim SchedRecalc As Date
Sub Recalc()
With Sheet1.Range("B1")
.Value = Format(Time, "hh:mm:ss AM/PM")
End With
Call SetTime
End Sub
Sub SetTime()
SchedRecalc = Now + TimeValue("00:00:01")
Application.OnTime SchedRecalc, "Recalc"
End Sub
Sub Disable()
On Error Resume Next
Application.OnTime EarliestTime:=SchedRecalc, Procedure:="Recalc", Schedule:=False
End Sub
Feel free to reply if you face any issues