Hi, this is my first post so go easy on me please.
I have done some very basic VB in the past and am trying to start from the basics again.
Can anyone tell me what I am doing wrong here? Basically all I am tring to do is to input a number between 15.00 and 59.99 and then round it up and output to another text box?
Any idea why this isn't working?
Regards
Matt
I have done some very basic VB in the past and am trying to start from the basics again.
Can anyone tell me what I am doing wrong here? Basically all I am tring to do is to input a number between 15.00 and 59.99 and then round it up and output to another text box?
Any idea why this isn't working?
Regards
Matt
Code:
Private Sub Command0_Click()
Dim oldValue As Integer
Dim newValue As Integer
oldValue = Text1.Value
newValue = Text7.Value
Select Case oldValue
Case 1 To 14.99
GoTo Error
Case 15 To 19.99
newValue = 19.99
Case 20 To 24.99
newValue = 24.99
Case 25 To 29.99
newValue = 29.99
Case 30 To 34.99
newValue = 34.99
Case 35 To 39.99
newValue = 39.99
Case 40 To 44.99
newValue = 44.99
Case 45 To 49.99
newValue = 49.99
Case 50 To 54.99
newValue = 54.99
Case 55 To 59.99
newValue = 59.99
Case Else
GoTo Error
Text7.Text = newValue
Error: MsgBox ("That is not a valid number")
End Select
End Sub
Last edited: