Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I'm having a problem with a form, I use a combo box to select values from, but when I read the cell on the work sheet it refers to, it the cell is empty it come up with an error. I thought that - Subsyst.AddItem "" , would handle it but it doesn't, any help would be appreciated this is the code I use to populate the combo box Private Sub addSubsyst() Subsyst.AddItem "" Subsyst.AddItem "S01" 'ListIndex = 1 Subsyst.AddItem "S02" 'ListIndex = 2 Subsyst.AddItem "S03" 'ListIndex = 3 Subsyst.AddItem "S04" 'ListIndex = 4 Subsyst.AddItem "S05" 'ListIndex = 5 Subsyst.AddItem "S06" 'ListIndex = 6 Subsyst.AddItem "S07" 'ListIndex = 7 Subsyst.AddItem "S08" 'ListIndex = 8 Subsyst.AddItem "S09" 'ListIndex = 9 Subsyst.AddItem "S10" 'ListIndex = 10 Subsyst.AddItem "S12" 'ListIndex = 11 Subsyst.AddItem "N/A" 'ListIndex = 12 'Use drop-down list Subsyst.Style = fmStyleDropDownList 'Combo box values are ListIndex values Subsyst.BoundColumn = 0 'Set combo box to first entry Subsyst.Width = 60 Subsyst.ListWidth = 55 End Sub And this to read from the work sheet to populate the form with data Private Sub getmine() Select Case itmnum Case 4 To LastRow - 1 Itemnumbx.Text = Cells(itmnum, 1) Itemdescr.Text = Cells(itmnum, 2) Spec.Text = Cells(itmnum, 3) Wesnum.Text = Cells(itmnum, 4) Locat.Text = Cells(itmnum, 5) valadd.Text = Cells(itmnum, 6) evatxt.Text = Cells(itmnum, 7) nvatxt.Text = Cells(itmnum, 8) walk.Text = Cells(itmnum, 9) auto.Text = Cells(itmnum, 10) ComboBox1 = Cells(itmnum, 11) Subsyst.Text = Cells(itmnum, 18) Case Else Itemnumbx.Text = itmnum - 3 ClearData End Select DisableSave End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
combo box - VBA form | Excel Discussion (Misc queries) | |||
linking a form combo box... results from the combo box to another | Excel Discussion (Misc queries) | |||
Can't seem to get Combo Box on User Form | Excel Programming | |||
Run Time Error 424 Combo Box User Form | Excel Programming | |||
Form Combo Box | Excel Discussion (Misc queries) |