Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
In an Excel 2000 spreadsheet on Windows XP, I have a multi-selection listbox, lbxQuanity, on UserForm2 that displays numbers from 1 to 12500. This is so the employee can choose the quantities in a quote calculation. A customer could request pricing for up to 3 quantities for each price break. These are the 10 price breaks: 1-9, 10-19, 20-49, 50-99, 100-249, 250-499, 500-999, 1000-2499, 2500-4999, 5000 & Up I need to populate cells with the quantities the employee has selected. The first selection in price break 1-9 should populate cell E83 The second selection if there is one for this price break should populate cell E89. And the third selection, if there is one, should populate cell E95 Any selections in the next price break, 10-19, would populate F83, F89 and F95. The selections for price break 20-49 would populate G83, G89 and G95. And so on for each price break. In the click event of a command button, CommandButton1, I've begun with the following code: 'The message boxes are there just for testing. Private Sub CommandButton1_Click() Dim i As Integer 'counter Dim NothingThere As Boolean 'flag for no selection NothingThere = True For i = 0 To lbxQuantity.ListCount - 1 'loop the list If lbxQuantity.Selected(i) Then MsgBox lbxQuantity.List(i) & " is selected. Action here." NothingThere = False End If Next If NothingThere = True Then MsgBox "No selection is made, whatever here" End If End Sub I don't know which order to test which price break the selection belongs in. I don't know how to determine how many selections exist for each price break so I can place the value in the appropriate cell. Does anyone have any suggestions? Thanks, Dan Dungan |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Listbox Multi Select | Excel Programming | |||
Multi Selection in a ListBox | Excel Programming | |||
Multi-select listbox help! | Excel Programming | |||
Listbox multi selection | Excel Programming | |||
multi select listbox | Excel Programming |