LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Loop with activeX optionbuttons.

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



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UserForm OptionButtons Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 3 October 4th 07 07:52 PM
Moving OptionButtons MarkyB Excel Discussion (Misc queries) 2 March 7th 06 02:50 PM
OptionButtons Paul Excel Programming 4 December 4th 03 04:12 PM
Add OptionButtons in Excel Andrew Lenczycki Excel Programming 0 July 30th 03 02:34 PM
optionbuttons Phil Perry Excel Programming 1 July 10th 03 09:13 PM


All times are GMT +1. The time now is 01:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"