sarasotavince
New Member
- Joined
- May 14, 2011
- Messages
- 24
Hello One and All:
I have 20 options buttons grouped and each has a unique caption. I am trying to populate a textbox on a different userform with the following code:
Dim i As Integer
With ActiveSheet
For i = 1 To .OptionButtons.Count
If .OptionButtons(i).Value = True Then
Enter_All.PrimaryPieceType.Value = .OptionButtons(i).Caption
End If
Next i
End With
Unload Me
The code runs without error, unloads the userform, but does not populate the selected (true) option buttons caption in the textbox PrimaryPieceType on the Enter_All userform. I must be overlooking something.
Any help is much appreciated. Thanks
I have 20 options buttons grouped and each has a unique caption. I am trying to populate a textbox on a different userform with the following code:
Dim i As Integer
With ActiveSheet
For i = 1 To .OptionButtons.Count
If .OptionButtons(i).Value = True Then
Enter_All.PrimaryPieceType.Value = .OptionButtons(i).Caption
End If
Next i
End With
Unload Me
The code runs without error, unloads the userform, but does not populate the selected (true) option buttons caption in the textbox PrimaryPieceType on the Enter_All userform. I must be overlooking something.
Any help is much appreciated. Thanks