PDA

View Full Version : [SOLVED:] enter choosen OptionButtons caption to cell



petroj02
06-21-2016, 05:10 AM
Hello everyone,
lets interduce my Problem. I have a several Option Buttons, from These Buttons i can pick only one possibility and this possibility, I would like to save to cell in Excel. I have created this code

Private Sub CommandButton3_Click()
Dim x As Integer
x = 9
For x = 9 To 18
If Configurator.MultiPage1.OptionButton & x.Value = True Then
ThisWorkbook.Sheets("Configuration").Cells(10, 3) = Configurator.MultiPage1.OptionButton & x.Caption
End If
Next x
End Sub

,but it sends me error mesagge like object doesnt support this property or method. I guess I cant make a string OptionButton & x, but i dont have idea how to solve this Problem. I really apriciate every single help.

mdmackillop
06-21-2016, 05:46 AM
Welcome to VBAX
Please post a copy of your workbook. Go Advanced/Manage Attachmennts

petroj02
06-21-2016, 09:06 PM
16445

Here is coppy of my workbook

snb
06-22-2016, 01:11 AM
Private Sub CommandButton3_Click()
For j = 9 To 18
If Me("OptionButton" & j) Then
ThisWorkbook.Sheets("Configuration").Cells(10, 3) = Me("OptionButton" & j).Caption
exit for
End If
Next
End Sub

petroj02
06-22-2016, 02:12 AM
This work just I wanted to.... Thanks for your help.
Now I can close this Topic.