Userform listbox row selection fails

Hilarys

New Member
Joined
Nov 1, 2021
Messages
10
Office Version
  1. 2019
Platform
  1. Windows
I have a UserForm which includes two ListBoxes on one page of a MultiPage. The two ListBoxes are identical apart from the ControlSource and the position on the form. In one of the ListBoxes, a mouse click on a populated row highlights the row and writes the bound column data to the ControlSource, i.e. as expected. In the other ListBoxe, a mouse click causes the bound column data to flash in the ControlSource, but it then disappears, and no highlighting occurs, so row selection is impossible. What am I doing wrong?
 
OK, thanks. I'll proceed with the beige version. More in due course.
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
It might be worth just amending that code to:

Code:
mystring = "Display!CG2:CI" & cmy + 10
msincs.MultiPage1.Pages(4).Controls("ctomsexist").List = Application.Range(mystring).value
mystring = "Display!CM2:CO" & cmn + 10
msincs.MultiPage1.Pages(4).Controls("ctomscand").List = Application.Range(mystring).Value

and see if the issue still persists.
 
Upvote 0
It might be worth just amending that code to:

Code:
mystring = "Display!CG2:CI" & cmy + 10
msincs.MultiPage1.Pages(4).Controls("ctomsexist").List = Application.Range(mystring).value
mystring = "Display!CM2:CO" & cmn + 10
msincs.MultiPage1.Pages(4).Controls("ctomscand").List = Application.Range(mystring).Value

and see if the issue still persists.
I'm afraid the issue does persist. I tried the code above in the order shown and also in line 3,4,1,2 order, but it's the same ListBox (which is displayed above the other ListBox on the form) that fails; it's nothing to do with the order of the code.
 
Upvote 0
I think I'd have to see a representative workbook then. Something must be resetting the listbox, from what you describe.
OK, I've built a beige version that misbehaves in the same manner. I also deleted the offending ListBox and re-created it and the problem persists. How do I ship the workbook?
 
Upvote 0
Do you have access to a file sharing platform like Onedrive or Dropbox where you can upload it and share a link?
 
Upvote 0
Here's a link.


There's a start button on worksheet "StandingData". If you pick page "Make/ Break a recipe's Links", and then choose "Crab and vermicelli salad" from the ComboBox, you should find that items in the lower ListBox are selectable whereas they're not selectable in the upper ListBox. If you switch to "Make /Break Ingredient's links" and choose "Cromer crabs" it all works as we'd like.
Thanks!
 
Upvote 0
You have two controls with ControlData!A12 as the controlsource - the problem listbox and the asmods listbox. You need to change one of them. ;)
 
Upvote 0
Solution
Thank you for your attention and patience. Sorry I'm such an idiot...
 
Upvote 0
Glad we could help. And don't worry - it's easily done! :)
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,595
Members
449,089
Latest member
Motoracer88

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