Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have this code thus far, which Ive copied pretty much. ----------------- Option Explicit Private Const Sourcename As String = "SubsTargets" Private Source As Range Private Sub cmdClose_Click() Unload Me End Sub Private Sub Label2_Click() End Sub Private Sub Titles_Click() End Sub Private Sub UserForm_Click() End Sub Private Sub UserForm_Initialize() Set Source = Range(Sourcename) LoadMarkets End Sub Private Sub LoadMarkets() Dim markets As New Scripting.Dictionary Dim index As Long Dim market As String For index = 2 To Source.Rows.Count market = Source.Cells(index, 1) If Not markets.Exists(market) Then markets.Add market, market Editors.AddItem market End If Next End Sub Private Sub Editors_Change() LoadMarketData LoadTitlesData End Sub Private Sub LoadMarketData() Dim market As String Dim index As Long Dim titleselection As String market = Editors.Value titleselection = TitleSelect.Value With Titles .Clear For index = 2 To Source.Rows.Count If Source.Cells(index, 1).Value = market Then .AddItem Source.Cells(index, 2) .List(.ListCount - 1, 1) = Source.Cells(index, 3) .List(.ListCount - 1, 2) = Source.Cells(index, 4) End If Next End With End Sub Private Sub LoadTitlesData() Dim market As String Dim index As Long market = Editors.Value With TitleSelect .Clear For index = 2 To Source.Rows.Count If Source.Cells(index, 1).Value = market Then .AddItem Source.Cells(index, 3) End If Next End With End Sub ------------------------ My first drop down being the Editors. The second down being Load TitlesData. The listbox being loadmarketdata. How do I alter the code in the loadmarketdata routine so that it depends on both the Editor selection (already done) but then on the title select??? TIA Matthew |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I fill a cell in a user form from a selection on same form? | Excel Discussion (Misc queries) | |||
User Form | Excel Programming | |||
How to: User Form to assign a user defined range to a macro variab | Excel Programming | |||
I am looking to see if anybody has an equivalant user form to Outlooks CONTACT form | Excel Programming |