Drmwvr7266
Board Regular
- Joined
- Apr 7, 2002
- Messages
- 164
Is there a way to shorten this code? I'm assuming that maybe if I used a group name, such as "widgets", that I can shorten it.
Private Sub Commandbutton1_Click()
If OptionButton1.Value = True Then
Topleft
Exit Sub
Else
If OptionButton2.Value = True Then
TopRight
Exit Sub
Else
If OptionButton3.Value = True Then
Bottomleft
Exit Sub
Else
If OptionButton4.Value = True Then
BottomRight
Exit Sub
Else
If OptionButton5.Value = True Then
Deadcenter
Exit Sub
Else
MsgBox "You need to select a position for your message", , "Select Position"
End If
End If
End If
End If
End If
End Sub
Any ideas?
Private Sub Commandbutton1_Click()
If OptionButton1.Value = True Then
Topleft
Exit Sub
Else
If OptionButton2.Value = True Then
TopRight
Exit Sub
Else
If OptionButton3.Value = True Then
Bottomleft
Exit Sub
Else
If OptionButton4.Value = True Then
BottomRight
Exit Sub
Else
If OptionButton5.Value = True Then
Deadcenter
Exit Sub
Else
MsgBox "You need to select a position for your message", , "Select Position"
End If
End If
End If
End If
End If
End Sub
Any ideas?