J
Jan Vente
Dear listmembers,
In a spreadsheet with activeX optionbuttons (not the "old" forms
optionbuttons). A macro renames the name of the object en places the new
name in de caption of the optionbutton. In this loop some of the names and
the captions are mixed. The controls get the correct names, but get a wrong
caption. If I fysically rearrange the optionbuttons in the order of the
captions, the macro still mixes up the same names and captions. In the
listing below you will find a simplified example of the code.
It the problem exist by 15 of 300 optionbuttons.
I'll hope you will understand the problem en could help me.
TIA Jan Vente
dim oleObj as OLEobject
dim optObj as msforms.optionbutton
dim wsV as Worksheet
dim intX as integer
set wsV = worksheets("Vragen")
intX = 1
For Each oleObj In wsV.OLEObjects
If TypeOf oleObj.Object Is MSForms.OptionButton Then
Set optObj = oleObj.Object
oleObj.Visible = True
strNaam = "opt" & str(intX)
oleObj.Name = strNaam
optObj.Caption = strNaam
intX = intX +1
end if
Next oleObj
In a spreadsheet with activeX optionbuttons (not the "old" forms
optionbuttons). A macro renames the name of the object en places the new
name in de caption of the optionbutton. In this loop some of the names and
the captions are mixed. The controls get the correct names, but get a wrong
caption. If I fysically rearrange the optionbuttons in the order of the
captions, the macro still mixes up the same names and captions. In the
listing below you will find a simplified example of the code.
It the problem exist by 15 of 300 optionbuttons.
I'll hope you will understand the problem en could help me.
TIA Jan Vente
dim oleObj as OLEobject
dim optObj as msforms.optionbutton
dim wsV as Worksheet
dim intX as integer
set wsV = worksheets("Vragen")
intX = 1
For Each oleObj In wsV.OLEObjects
If TypeOf oleObj.Object Is MSForms.OptionButton Then
Set optObj = oleObj.Object
oleObj.Visible = True
strNaam = "opt" & str(intX)
oleObj.Name = strNaam
optObj.Caption = strNaam
intX = intX +1
end if
Next oleObj