Edit Multi-Column List Box
-
- Administrator
- Posts: 78642
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- NewLounger
- Posts: 5
- Joined: 11 May 2013, 17:13
Re: Edit Multi-Column List Box
The line that writes "yes" to the active sheet is deselecting items in the list box.
-
- Administrator
- Posts: 78642
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Edit Multi-Column List Box
I see no reason why writing "Yes" in a cell would deselect items in a list box. Can you attach a small sample workbook demonstrating the problem? (Max. file size 250 KB).
Thanks in advance.
Thanks in advance.
Best wishes,
Hans
Hans
-
- NewLounger
- Posts: 5
- Joined: 11 May 2013, 17:13
Re: Edit Multi-Column List Box
Hi, Please see attached. I have only includes the parts of the program in question to save on file size.
I have included a comment block within the code, the problem line is within that block.
Run the sheet from "Home" without touching the code first and select two or more items then click print. I have replaced the print code with a msgbox to save your ink lol
Once you see how it should work, uncomment the problem line and repeat. It should make sense then.
Thanks a million!
I have included a comment block within the code, the problem line is within that block.
Run the sheet from "Home" without touching the code first and select two or more items then click print. I have replaced the print code with a msgbox to save your ink lol
Once you see how it should work, uncomment the problem line and repeat. It should make sense then.
Thanks a million!
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78642
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Edit Multi-Column List Box
Thanks! The reason is that the list box has a range as row source. The moment you change a value in that range, the list box is automatically refreshed, and this causes all items to be deselected.
The easiest workaround is to use the AddItem method to populate the list box instead of setting the row source.
See the attached version.
The easiest workaround is to use the AddItem method to populate the list box instead of setting the row source.
See the attached version.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- NewLounger
- Posts: 5
- Joined: 11 May 2013, 17:13
Re: Edit Multi-Column List Box
you legend!!!!! THANK YOU!!!!!!!!