I have an Order Sheet which includes a combination of check boxes and also option buttons.
- There are 10 rows of 3 option buttons and 1 checkbox. Each row is grouped together.
- The check boxes work fine and I am able to refer to them using a variable
iwhich refers to the row number.- I have tried to do the same for the Option buttons. I.e I am trying to refer to the option buttons using variable
i. However, I have been unable to find a solution.
- I have tried to do the same for the Option buttons. I.e I am trying to refer to the option buttons using variable
This is the code I am using to refer to the check-boxes using variable i. This works fine.
If Sheets("Order Sheet").Shapes("Check Box " & i).ControlFormat.Value = 1 Then
I have used a similar logic to try and refer to the option buttons. However, all variations of my trial and error based on vaguely similar things that I have found online have failed.
If OLEObjects("OptionButton" & i + 30).Object.Value = True Then
The current error with the code snippet above is "Sub or function not defined". Highlighting the OLEObjects line of code.
Any help or direction on where to go with including a variable in the naming of the option buttons would be greatly appreciated.
If Sheets("Order Sheet").Shapes("Option Button " & i).ControlFormat.Value = 1 Then?