Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a macro with 2 listboxes that I want to use for selecting values from
2 lists. The main macro shows both lists sequentially and then uses the 2 selected values to process data. Unfortunately when certain values in the first list are selected, the 2nd list box is not displayed but the main macro code continues as if a val;ue from the 2nd list had been selected. Below is the code in which the same form is used for both lists. I tried using two separate forms but that didn't help. If I uncomment the msgbox code in the init routine, the lists work properly. Column A has values a,b,c,d,e,blank and column b has values 1,2,3, blank ====================== Private Sub ListBox1_Click() poolName = ListBox1.Value Unload Me End Sub Private Sub userform_initialize() 'MsgBox "form 1 init" Windows("InvoiceMacro.xls").Activate Sheets("Lists").Select If listnum = 1 Then Range("a1").Select Else Range("b1").Select Do Until ActiveCell.Value = "" ListBox1.AddItem (ActiveCell.Value) ActiveCell.Offset(1, 0).Select Loop End Sub Private Sub UserForm_Click() End Sub ++++ main macro Sub doboth() listnum = 1 frmListbox1.Show listnum = 2 frmListbox1.Show End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Calculate working days but change working week | Excel Discussion (Misc queries) | |||
Making weekend days working days - the system cuts the working tim | Excel Discussion (Misc queries) | |||
Listbox's and retaining data when closing | Excel Programming | |||
LISTBOX'S | Excel Programming | |||
Adding sales from a non working day to the previous working day | Excel Programming |