ListBox RowSource not loading all values

sharky12345

Well-known Member
Joined
Aug 5, 2010
Messages
3,422
Office Version
  1. 2016
Platform
  1. Windows
I have a range of numeric values currently between N2:N13 and I need those loaded into a Listbox using this;

Code:
ListBox3.RowSource = Range(Sheet5.Range("N2"), Sheet5.Range("N65536").End(xlUp)).Address(, , , True)

The issue is that it is only loading the first value, from N2 and nothing else.

I'm using the same method of another column which has values consisting of text and numeric, like this;

Code:
ListBox2.RowSource = Range(Sheet5.Range("L2"), Sheet5.Range("L65536").End(xlUp)).Address(, , , True)

that one works fine, so I don't understand why the first one doesn't work - is it something to do with the fact that they are numeric only?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Disregard guys - not sure what had happened but it's now working fine....
 
Upvote 0
If you were wanting to load all the values in Sheet(5) column(N) from row 2 to last row with data this is how I do it:

Code:
Private Sub CommandButton1_Click()
ListBox1.Clear
Dim Lastrow As Long
Lastrow = Sheets(5).Cells(Rows.Count, "N").End(xlUp).Row
Data = Sheets(5).Range("N2:N" & Lastrow)
ListBox1.List = Data
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,185
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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