View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
crazybass2 crazybass2 is offline
external usenet poster
 
Posts: 167
Default ComboBox Row Source across ALL sheets

Corey,

From what I've read of your past posts, I think this is what you're looking
for. You need to have a crossreference for customer/conveyor number. Since
I have found no reference to it in your previous posts, I've assumed that
each sheet is for a specific customer and has a list of the conveyor numbers
for that customer. In the code, customer names are in Combobox1, converyors
are in Combobox2. You will need to change these references to match yours.
Each time Combobox1 changes Combobox2 will be cleared a repopulated with the
appropriate converyor numbers. You will need to write the code to replace
the "Set cvs = wks.range("A2:A5")" line to fit the location of the converyor
numbers.

Add this code to your Userform module:

Private Sub ComboBox1_Change()
Dim cvs As Range
ComboBox2.Clear
For Each wks In Worksheets
If wks.Range("A1").Text = ComboBox1.Value Then
Set cvs = wks.Range("A2:A5") 'CHANGE THIS LINE TO REFERENCE YOUR CVs
For Each cv In cvs
ComboBox2.AddItem cv.Text
Next cv
End If
Next wks
End Sub

If this is not how your sheets are setup, please reply and detail how the
customer/conveyor numbers are cross-referenced.

Mike

"Corey" wrote:


Norman, thanks for your assistance.

I have got the 2 ComboBox lists populated now.
One for the Customer name and
the 2nd one for the Conveyor Name.
Both have values from the WorkSheet cells now.

However, is there a way to CONDITION the 2nd ComboBox to ONLY populate with
RELATED Conveyors ?
EG.
If Customer FRED has a Conveyor CV1
& Customer BARNEY has a Conveyor CV5,

Currently when i Pick say FRED from the 1st ComboBox, the Conveyor ComboBox
displays CV1 & CV5. Where CV5 is NOT a Conveyor that belongs to FRED.


Regards
Corey....