I have an Excel workbook with 16 sheets.
I want a listbox on my userform which will list the data in Sheet 1 Cells F2 to F50.
My code
Private Sub UserForm_Initialize()
ListBox1.Clear
Sheet11.Activate
ListBox1.RowSource = "Sheet11!F2:F10"
End Sub
It returns error
"Run Time Error '380' Could Not set the RowSource property. Invalid Property Value"
Sheet11? - SJRMe.oMyListBox.List = oMyWB.oMyWS.ListObjects("<table name>").DataBodyRange.Value- Zac"Sheet11!F2:F10"is looking for a sheet named "Sheet11" usingSheet11.Activateis actually activating the 11th sheet. You should be using the sheet name not the sheet index. As the row source. You do not need to activate the sheet to populate the listbox, unless you really want to. - Davesexcel