Hi again !
So Here is the macro I have created:
It works so I'm content (it may seem trivial and flawed to you but as I said I only just began so I only know the very basic stuff) anyway I was wondering if you could see anything really wrong with it, or something I could obviously improve about it?Dim NAME As String Dim OVERTIME As Integer Dim ABSENT As Integer Dim X As Integer Dim Bonus As Integer NAME = InputBox("Enter name") OVERTIME = InputBox("Enter hours of overtime") ABSENT = InputBox("Enter hours of absenteism") X = OVERTIME - 2 * ABSENT / 3 If X > 40 Then Bonus = 50 If X > 30 And X <= 40 Then Bonus = 40 If X > 20 And X <= 30 Then Bonus = 30 If X > 10 And X <= 20 Then Bonus = 20 If X <= 10 Then Bonus = 10 MsgBox ("Bonus" & Bonus)
For instance, should some of the data be introduced As Double (Dim ... As Double)?
Many thanks again





Reply With Quote