I have two listboxes with listbox1 controls listbox2. It works fine except when the name range has only one item, it gives a type mismatch error. Can someone point out the obvious? Many thanks!
![]()
Please Login or Register to view this content.
I have two listboxes with listbox1 controls listbox2. It works fine except when the name range has only one item, it gives a type mismatch error. Can someone point out the obvious? Many thanks!
![]()
Please Login or Register to view this content.
Can you attach your sample workbook?
< ----- Please click the little star * next to add reputation if my post helps you
Visit Forum : From Here
If it's one item, the variant variable is not an array and the .List property won't accept a single value. Below converts a single value to an array if needed.
Also; remove the () from Dim dataLbx2() As Variant
![]()
Please Login or Register to view this content.
Surround your VBA code with CODE tags e.g.;
[CODE]your VBA code here[/CODE]
The # button in the forum editor will apply CODE tags around your selected text.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks