VBA

Moderators: PavlinII
Number of threads: 1614
Number of posts: 3000

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
multicolumn listbox with formatted fields Posted by leonv on 6 Oct 2007 at 8:39 AM
Greetings
I am fairly new to Excel VBA and need some help. I have an excel form that inlcudes a multicolumn listbox that displays item number, item description, and price. It is populated from a master spreadsheet which includes an amount field. The amount field in the spreadsheet is (apparently) is a float as there are values such as 1924.3439. The cells are formatted as currency, so the example shows up as $1,924.34. The master sheet also needs to be filtered based on other selections in the form.

If I use rowsource to populate the listbox, it picks up the currency formatting, but it displays all rows regardless of any data filtering.

If I copy the range to an array and then copy the array to the listbox, I get only the filtered rows, but I get unformatted numbers (floats) insead of formatted as currency.

How can I populate a multicolumn listbox with formatted values? Is there a way to have rowsource only pick up visible cells?

Or, is there a simple way to format the data in the array? I tried using value2, but that didn't pick up the currency format.

Your help will be greatly appreciated!
Leonv



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.