SOLVED

VBA - Show data selection in pop-up menu

Gold Contributor
Hi Guys,
have a "little" problem where I need a little help.
I have a user form with a list field where I take data from a table from another worksheet.
My problem is that it only shows the labeling area and not the data.
 
VBA Code in Scheet1

Option Explicit

Private Sub Worksheet_BeforeRightClick(ByVal Target As Excel.Range, Cancel As Boolean)

Me.Unprotect ("1234")

    If Not Intersect(Target, Range("G5:EZ6")) Is Nothing Then

        Cancel = True

        ASK_Auswahl.Show

    End If

    Me.Protect ("1234")

End Sub

 

User Form in sheet 1

Displayed data in UserForm (list field)Displayed data in UserForm (list field)

 

Sheet2 - table where the data is taken from

Daten in Tabelle.JPG

 

Properties window in lists Box1

Properties window in lists Box1Properties window in lists Box1

 

How can I get all data from Sheet2 to be displayed in the user form?

 

Thx in Advance :)

 

Nikolino

 

3 Replies
best response confirmed by NikolinoDE (Gold Contributor)
Solution

@NikolinoDE 

In your ListBox, the ColumnCount property is set to 1 and that means only 1 column would be displayed in the ListBox. Therefore increase the ColumnCount property of the ListBox according to the source data range.

hank you very much ... was too logical to have seen it :) ... Now that I can see it, I can understand what I missed ... thank you.

@NikolinoDE 

You're welcome! Glad I could help.

1 best response

Accepted Solutions
best response confirmed by NikolinoDE (Gold Contributor)
Solution

@NikolinoDE 

In your ListBox, the ColumnCount property is set to 1 and that means only 1 column would be displayed in the ListBox. Therefore increase the ColumnCount property of the ListBox according to the source data range.

View solution in original post