Forum Discussion

NikolinoDE's avatar
NikolinoDE
Gold Contributor
Jul 26, 2020
Solved

VBA - Show data selection in pop-up menu

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)

 

Sheet2 - table where the data is taken from

 

Properties window in lists Box1

Properties window in lists Box1

 

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

 

Thx in Advance 🙂

 

Nikolino

 

  • 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.

  • 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.

    • NikolinoDE's avatar
      NikolinoDE
      Gold Contributor
      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.

Resources