Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-18-2014, 04:23 PM
CoolBlue's Avatar
CoolBlue CoolBlue is offline This is a Userform LIstbox queston: A variable does not set to the value of a listbox Windows 7 64bit This is a Userform LIstbox queston: A variable does not set to the value of a listbox Office 2013
Advanced Beginner
 
Join Date: Jun 2014
Location: Australia
Posts: 40
CoolBlue is on a distinguished road
Default

Quote:
Originally Posted by whatsup View Post
Hi CoolBlue

I haven't checked if the file is corrupt neither where the bug sits. Myself I'm hardly using the rowsource-property and never the value-property (on ListBoxes !!!). Therefore my advice generally is - unless you intend using the listbox for reading purposes only -, don't go with the rowsource but use the list-property.
Using ListIndex in reading from the Listbox and marking a "value" makes both much easier as bothering with value.



Hi Whatsup

Based on the research I did, I think your original post was the best solution. My feeling is that the root cause is just a bug in VBA.

I haven't seen problems with .RowSource although, you do need to be careful to fully qualify the Address of the range; I use .Address(External:=True) to take care of that. Have you noticed specific problems with it when using ListBox, or do you just generally avoid it because of the buggy .Value behaviour?
Reply With Quote
  #2  
Old 08-18-2014, 08:14 PM
whatsup whatsup is offline This is a Userform LIstbox queston: A variable does not set to the value of a listbox Windows 7 64bit This is a Userform LIstbox queston: A variable does not set to the value of a listbox Office 2010 32bit
Competent Performer
 
Join Date: May 2014
Posts: 137
whatsup will become famous soon enough
Default

Never got that far looking for bugs concerning RowSource. There's only one advantage of that property: It allows Columnheads.
If you don't need them, you're much better off using the list-property. It allows you either fill it by arrays or refering to ranges, you can remove, add, modify, ... whatever you want.

If you need headers you might be interested in the ListView-Control, that one even provides additional options - though more difficult to handle than the common ListBox.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
This is a Userform LIstbox queston: A variable does not set to the value of a listbox Moving Selected Items from a Multiselect Listbox on a userform to a bookmark in Word marksm33 Word VBA 3 01-15-2015 07:55 PM
This is a Userform LIstbox queston: A variable does not set to the value of a listbox This is a Userform LIstbox queston: A variable does not set to the value of a listbox CatMan Excel 1 08-08-2014 09:41 AM
Checkboxes are unchecked in Listbox that were checked off before.How can I stop this? Rochelle711 Excel Programming 0 06-22-2014 06:16 PM
This is a Userform LIstbox queston: A variable does not set to the value of a listbox Multi-select listbox help gvibe@hotmail.com Word VBA 1 07-19-2013 10:54 AM
as the return value of another column, using Listbox? marreco Excel Programming 1 03-27-2012 12:48 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:32 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft