Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Referencing to controls on a worksheet

A worksheet I made has a number of controls (10
ComboBoxes).
How can controls be referenced as a group ?
I tested the structure :
For each ctl in Activesheet.Controls
.....
Next
but it didn't work...
Is there any solution out there?
Thanks
John Nikolopoulos
Serres, GREECE
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Referencing to controls on a worksheet

Assume these are comboboxes from the Control Toolbox Toolbar as opposed to
the Forms toolbar.
Dim OleObj as OleObject
Dim cbox as MSForms.Combobox
For each OleObj in ActiveSheet.OleObjects
if typeof OleObj is MSForms.Combobox then
set cbox = OleObj.Object
msgbox cbox.Name
End if
Next

--
Regards,
Tom Ogilvy


"John Nikolopoulos" wrote in message
...
A worksheet I made has a number of controls (10
ComboBoxes).
How can controls be referenced as a group ?
I tested the structure :
For each ctl in Activesheet.Controls
.....
Next
but it didn't work...
Is there any solution out there?
Thanks
John Nikolopoulos
Serres, GREECE



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Referencing to controls on a worksheet

Yep, thanks for the catch:

Assume these are comboboxes from the Control Toolbox Toolbar as opposed to
the Forms toolbar.
Dim OleObj as OleObject
Dim cbox as MSForms.Combobox
For each OleObj in ActiveSheet.OleObjects
if typeof OleObj.Object is MSForms.Combobox then
set cbox = OleObj.Object
msgbox cbox.Name
End if
Next


--
Regards,
Tom Ogilvy


"Dave Peterson" wrote in message
...
I think Tom meant:

If TypeOf OleObj.Object Is MSForms.ComboBox Then
instead of
If TypeOf OleObj Is MSForms.ComboBox Then



Tom Ogilvy wrote:

Assume these are comboboxes from the Control Toolbox Toolbar as opposed

to
the Forms toolbar.
Dim OleObj as OleObject
Dim cbox as MSForms.Combobox
For each OleObj in ActiveSheet.OleObjects
if typeof OleObj is MSForms.Combobox then
set cbox = OleObj.Object
msgbox cbox.Name
End if
Next

--
Regards,
Tom Ogilvy

"John Nikolopoulos" wrote in message
...
A worksheet I made has a number of controls (10
ComboBoxes).
How can controls be referenced as a group ?
I tested the structure :
For each ctl in Activesheet.Controls
.....
Next
but it didn't work...
Is there any solution out there?
Thanks
John Nikolopoulos
Serres, GREECE


--

Dave Peterson



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Referencing to controls on a worksheet


I would like to thank you for your instant reply.
It helps me a lot. Than you again.
sincerely Yours
John Nikolopoulos


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Reply
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
having two separate column width controls on same worksheet Help appreciated! Excel Discussion (Misc queries) 1 January 27th 10 09:59 PM
Protecting Controls in a worksheet Dire straits Excel Discussion (Misc queries) 2 August 12th 06 03:46 AM
Multiple Option Controls w/in Worksheet uberbetty Excel Worksheet Functions 1 July 30th 06 11:33 PM
Select All controls in a worksheet and delete them rova78 Excel Discussion (Misc queries) 1 April 28th 05 11:05 PM
Problems with worksheet containing ActiveX controls Deane Yang Excel Programming 1 August 21st 03 04:36 AM


All times are GMT +1. The time now is 09:45 PM.

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

About Us

"It's about Microsoft Excel"