select independent items from multiple columns in listbox/combobox

ricardomadaleno

Board Regular
Joined
Mar 25, 2012
Messages
65
Good afternoon everyone,

I am designing a userform and I have run into a bit of an issue.

I have a listbox with four columns full of data, and i want to select one item without having to select the entire line across the 4 columns.

for instance:
1234
5678
9101112
13141516

<tbody>
</tbody>

Imagine that this is my list box. What I need is to be able to select the number 6 without having to select the entire second line.

is this possible? it doesn't have to be with a listbox or a combobox, I open to all suggestions.

thank you for your help
 
Here's another property, List will return the string that is in a the quad box.
QuadBox.List(rowIndex, colIndex) will return the value
QuadBox.List(oneArg) will treat the list as a single list, depending on .ZFlowOrder

Code:
Property Get List(argIndex As Long, Optional colIndex As Long = 5) As String
    Dim rIndex As Long, cIndex As Long
    CleanIndexValues argIndex, colIndex, rIndex, cIndex
    With Me
        List = .Columns(cIndex).List(rIndex)
    End With
End Property
Property Let List(argIndex As Long, Optional colIndex As Long = 5, newIndex As String)
    Dim rIndex As Long, cIndex As Long
    CleanIndexValues argIndex, colIndex, rIndex, cIndex
    Me.Columns(cIndex).List(rIndex) = newIndex
End Property
Private Sub CleanIndexValues(ByRef argIndex As Long, ByRef colIndex As Long, _
                                            ByRef rIndex As Long, ByRef cIndex As Long)
       If 4 < colIndex Then
        Rem one argument past, treat as folded list
        If ZFlowOrder Then
            rIndex = Int(argIndex / 4)
            cIndex = (argIndex) Mod 4
        Else
            cIndex = -1
            Do
                cIndex = cIndex + 1
                rIndex = argIndex
                argIndex = argIndex - Columns(cIndex).ListCount
            Loop Until argIndex < 0
        End If
    Else
        Rem two arguments passed
        rIndex = argIndex
        cIndex = colIndex
    End If
End Sub
 
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Hi Mike,

Than was amazing... thank you so much for you help.

I have a lot to learn about Class Modules yet, and this will surely help a lot to that as well.

Thanks :)
 
Upvote 0

Forum statistics

Threads
1,215,692
Messages
6,126,228
Members
449,303
Latest member
grantrob

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top