Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default one sub for many Combos in different way

Hi,
I have following problem. I have variable count of sheets (+-8) and on
each of them 31ComboBoxex. I want one procedure for all combos in my
workbook. I am doing it in this way:

I have ClassModule with name ComboClass:

Public WithEvents ComboGroup As ComboBox

Private Sub ComboGroup_Change() 'this is the sub I want to run whe
someone click on any Combo
MsgBox "working!" 'just easy example
End Sub



Dim Comba() As New ComboClass 'global variable

And this is the sub that is filling ComboGroup:

Private Sub Filling()
Dim MemberCount As Integer
Dim Members As OLEObjects
Dim Member As OLEObject
Dim Lists As Sheets
Dim List As Worksheet

Set Lists= ThisWorkbook.Sheets
MemberCount = 0

For Each List In Lists
For Each Member In List.OLEObjects
If TypeName(Member.Object) = "ComboBox" Then
Member.ListFillRange = "List1!D6:D9" 'not important
Member.Object.ListIndex = 0
MemberCount = MemberCount + 1
ReDim Preserve Comba(1 To MemberCount)
Set Comba(MemberCount).ComboGroup = Member.Object
End If
Next Member
Next List
End Sub


It looks easy and it is. Problem is that I have almost 300 Combos and
the procedure Filling takes about 0.2sec and it is too much. And other
(and most important) disadvantage is that I must every Workbook_open
an when someone adds list with combos reinicilize ComboGroup (with sub
Filling).

Is there a possibility to make all combos processing same procedure
without "filling"? How to make myCombo that will do it in default way.
Sorry for my poor english :-(
and THX
joch.
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
table of # of rows with unique combos of values in 4 separated col louise Excel Worksheet Functions 7 June 5th 08 05:49 AM
Comparing two combos/cells to return a value [email protected] Excel Worksheet Functions 0 October 2nd 07 06:47 PM
Entering combos without converting it to dates? pkroper22 Excel Discussion (Misc queries) 2 February 28th 06 01:39 PM
Auto number w/ different letter-number combos in same column Colleen B Excel Worksheet Functions 2 February 23rd 05 02:41 PM


All times are GMT +1. The time now is 02:30 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"