Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 27th, 2007, 07:01 AM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default multiple Listbox values in another listbox

Hello

I have 2 listboxes in Excel 2003. I populate one listbox with an external source (Access table using Get External data/database query) rangename is companies. No problem with the first listbox, but the second listbox would be populated based on the selected item in the first listbox. In essence, the second listbox would have multiple results when an item is selected in the first listbox. I have also brought the values from a second table using the same method to display the quotes (rangename is quotes)

What I need to be able to do is to populate listbox2 using a vlookup, but I cannot seem to get any results in listbox2.

Here is my code at this point:

Function Getquotevalues()
Dim rng As Range
Dim srchstr As String
srchstr = Me.lbcompanies.Value
Set rng = Range("Quotes")
Getquotevalues = Application.WorksheetFunction.VLookup(srchstr, rng, 2, False)
End Function

Thank you for any help you can provide

Terry

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
To highlight multiple selected values in listbox lily611 General .NET 7 August 20th, 2007 12:59 AM
Applying Multiple Selected Values to a Listbox rit01 ASP.NET 2.0 Professional 1 December 15th, 2006 06:12 AM
Using Values from a ListBox timmaher Classic ASP Databases 2 September 14th, 2005 10:01 AM
Values from a ListBox mrideout BOOK: Beginning ASP.NET 1.0 0 December 1st, 2004 08:53 AM
Listbox Values Louisa VB.NET 2002/2003 Basics 1 February 13th, 2004 12:28 PM



All times are GMT -4. The time now is 12:17 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.