Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a userform that contains a listbox. Users can add values by entering
number in a textbox and clicking an "add" button. The problem is once a certain number of entries have been added, the next values appear at the end of the listbox. Using the .AddItem method, how do I add values to the beginning of the list? The code keeps saying it expects an "=" sign. Code: Private Sub cbCustomCodeAdd_Click() With Me If Not .tbCustomCode.Value = "" Then For Each item In .lbGathCodes.List If item = .tbCustomCode.Value Then .tbCustomCode.Value = "" Exit Sub End If Next item If Len(.tbCustomCode) 3 Then .tbCustomCode = Left(.tbCustomCode, 3) .lbGathCodes.AddItem (.tbCustomCode.Value) .tbCustomCode.Value = "" .lbGathCodes.Selected(.lbGathCodes.ListCount - 1) = True End If End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding item in listbox | Excel Worksheet Functions | |||
Adding item in listbox | Excel Worksheet Functions | |||
Adding Headers to a listbox | Excel Programming | |||
adding a listbox to a spreadsheet | Excel Programming | |||
Adding a row of data to a Listbox | Excel Programming |