Try using the case statement to simplify your code
Dim Pointer As Integer
Private Sub CommandButton1_Click()
Select Case Pointer
Case 0
Dietstate = "Dieting"
Case 1
Dietstate = "Diet Ruined"
Case 2
Dietstate = "Diet Not Ruined"
Case 10
Dietstate = "Starving"
Case 11
Dietstate = "Fasting"
Case 12
Dietstate = "Eating"
Case 20
Dietstate = "Dying"
Case 21
Dietstate = "Last Legs"
Case 22
Dietstate = "Deceased"
Case Else
Dietstate = "Dunno"
End Select
TextBox2.Value = Dietstate
End Sub
Private Sub OptionButton1_Click()
UpdatePointer
End Sub
Private Sub OptionButton2_Click()
UpdatePointer
End Sub
Private Sub OptionButton3_Click()
UpdatePointer
End Sub
Private Sub OptionButton4_Click()
UpdatePointer
End Sub
Private Sub UpdatePointer()
Pointer = 0
If OptionButton1 = True Then Pointer = Pointer + 1
If OptionButton2 = True Then Pointer = Pointer + 2
If OptionButton3 = True Then Pointer = Pointer + 10
If OptionButton4 = True Then Pointer = Pointer + 20
TextBox1.Text = "Pointer Value = " & Pointer
End Sub
Bookmarks