Range not appearing in ListBox
-
-
-
Re: Range not appearing in ListBox
Please use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window.
This is covered in the Forum Rules that you agreed to.
-
Re: Range not appearing in ListBox
Sorry. Have edited my last post and have also worked out the problem by changing the number of columns in the listbox properties.
-
Re: Range not appearing in ListBox
Quote from josh1981;641232ListBox control only accept one dimensional array and you are providing it two dimensional array.
If you want to add then you can do it like this:
Code
Display MorePrivate Sub UserForm_Initialize() Dim varData As Variant Dim varArrElement As Variant varData = Worksheets("Tides").Range("J3:P17").Value With CreateObject("Scripting.dictionary") For Each varArrElement In varData .Item(varArrElement) = 0 Next varArrElement varData = .keys End With ListBox1.List = varData End Sub
-
Re: Range not appearing in ListBox
Have you actually set the ColumnCount Property in the ListBox to 7
-
-
Re: Range not appearing in ListBox
Yes. As explained above I have changed the properties and that fixed the problem. Thanks.
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!