Here's the code so far:
Here's my newest error:FrmGet.TextBox1.Value = Application.WorksheetFunction.VLookup(FrmGet.CbAgent.Value, Range("lists"), 2, False)
any ideas?Unable to get the Vlookup property of the worksheetfunction class
Here's the code so far:
Here's my newest error:FrmGet.TextBox1.Value = Application.WorksheetFunction.VLookup(FrmGet.CbAgent.Value, Range("lists"), 2, False)
any ideas?Unable to get the Vlookup property of the worksheetfunction class
Mr MaGoo
Magoo.Inc MMVII
If i've helped please add to my Rep by Clicking on the Blue Scales in the top right hand corner of the post
I woulduse the VBA Find method
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
If that's the error then it probably means the lookup is returning N/A.
How have you populated your combobox?
What is it you are actually looking up?
To begin with the combobox is empty so it looks up nothing initially, maybe thats the problem? should i place the vlookup in the combobox_change event?
Thanks for the question you asked, it pointed me in the right direction,
i placed the lookup in the event change of the combobox and now it works,
it was obviously failing since the combobox was empty initially!!
get in!!
That isn't really what I'm asking.
How are you populating the values in the combobox dropdown?
Sorry i got a bit excited heres how i poulated the combobox mate:
Sheets("List").Select Range("A1").Select Do Until ActiveCell.Value = "" FrmGet.CbAgent.AddItem ActiveCell.Value ActiveCell.Offset(1, 0).Select Loop
Well if that's how you've populated the combobox there's no need for either a lookup or find.
The ListIndex of the combobox will correlate to the row number the data is on.
FrmGet.TextBox1.Value = Sheets("List").Range("A" & FrmGet.cbAgent.ListIndex+1)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks