View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Using Filtered Data for ComboBox

I put a couple of comboboxes from the control toolbox toolbar on a worksheet.

I put the listfillrange for the first combobox on a different sheet.

Then in the code for that first combobox, I had this:

Option Explicit
Private Sub ComboBox1_Change()

Dim myCell As Range

With Me.ComboBox2
.Clear
For Each myCell In Application.Range(Me.ComboBox1.ListFillRange)
If myCell.Text = Me.ComboBox1.Value Then
.AddItem myCell.Offset(0, 1).Value
End If
Next myCell
End With

End Sub



"cdos <" wrote:

I am pretty green when it comes to VBA, actually very green. But what I
am looking for is some idea of what some code would look like for the
following:

Say I have 6 options to choose from in the first ComboBox, however each
of those options have 10 subsets. What I am looking for is code that
will adjust the second ComboBox to show the correct subsets based on
the first selected data in the first ComboBox.

Anything would help, if my description is too confusing please tell me.
Thanks to anyone who takes the time to help me.

---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson