Option Explicit
Dim first As Double
Dim second As Double
Dim answer As Double
Dim operator As String

Private Sub CommandButton1_Click()
If TextBox1.Text = "0" Then
TextBox1.Text = "1"
Else
TextBox1.Text = TextBox1.Text + "1"
End If

End Sub

Private Sub CommandButton10_Click()
If TextBox1.Text = "0" Then
TextBox1.Text = "0"
Else
TextBox1.Text = TextBox1.Text + "0"
End If
End Sub

Private Sub CommandButton11_Click()
first = TextBox1.Text
TextBox1.Text = ""
operator = "+"
End Sub

Private Sub CommandButton12_Click()
first = TextBox1.Text
TextBox1.Text = ""
operator = "-"

End Sub

Private Sub CommandButton13_Click()
first = TextBox1.Text
TextBox1.Text = ""
operator = "*"

End Sub

Private Sub CommandButton14_Click()
first = TextBox1.Text
TextBox1.Text = ""
operator = "/"
End Sub

Private Sub CommandButton15_Click()
second = TextBox1.Text
If operator = "+" Then
answer = first + second
TextBox1.Text = answer
ElseIf operator = "-" Then
answer = first - second
TextBox1.Text = answer
ElseIf operator = "*" Then
answer = first * second
TextBox1.Text = answer
ElseIf operator = "/" Then
answer = first / second
TextBox1.Text = answer
End If
End Sub

Private Sub CommandButton16_Click()
TextBox1.Text = ""
End Sub

Private Sub CommandButton2_Click()
If TextBox1.Text = "0" Then
TextBox1.Text = "4"
Else
TextBox1.Text = TextBox1.Text + "4"
End If
End Sub

Private Sub CommandButton3_Click()
If TextBox1.Text = "0" Then
TextBox1.Text = "2"
Else
TextBox1.Text = TextBox1.Text + "2"
End If
End Sub

Private Sub CommandButton4_Click()
If TextBox1.Text = "0" Then
TextBox1.Text = "7"
Else
TextBox1.Text = TextBox1.Text + "7"
End If
End Sub

Private Sub CommandButton5_Click()
If TextBox1.Text = "0" Then
TextBox1.Text = "5"
Else
TextBox1.Text = TextBox1.Text + "5"
End If
End Sub

Private Sub CommandButton6_Click()
If TextBox1.Text = "0" Then
TextBox1.Text = "8"
Else
TextBox1.Text = TextBox1.Text + "8"
End If
End Sub

Private Sub CommandButton7_Click()
If TextBox1.Text = "0" Then
TextBox1.Text = "3"
Else
TextBox1.Text = TextBox1.Text + "3"
End If
End Sub

Private Sub CommandButton8_Click()
If TextBox1.Text = "0" Then
TextBox1.Text = "6"
Else
TextBox1.Text = TextBox1.Text + "6"
End If
End Sub

Private Sub CommandButton9_Click()
If TextBox1.Text = "0" Then
TextBox1.Text = "9"
Else
TextBox1.Text = TextBox1.Text + "9"
End If
End Sub

Private Sub TextBox1_Change()

End Sub