View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Eddie_SP[_2_] Eddie_SP[_2_] is offline
external usenet poster
 
Posts: 47
Default COMBOBOX SEL. / LISTBOX SHOW (VLookUp)

Hi Rick !

Thank you for your help. I'm still trying to check things here.
Changing to "Worksheets" gave me another problem

UNABLE TO GET THE VLOOKUP PROPERTY OF THE WORKSHEETFUNCTION CLASS.

But thank you anyway. =)

Eddie.


"Rick Rothstein" wrote:

If that is the actual name of your worksheet and not a variable name
containing your worksheet's name, then you need to use the Worksheets
property to reference the sheet. Try this...

Private Sub ComboBox1_Click()
Dim ComboCode As String
ComboCode = Application.WorksheetFunction.VLookup(ComboBox1.Va lue, _
Worksheets("PEDIDOS").Range("A6:J2000"), 2, 0)
ListBox1.Value = ComboCode
End Sub

--
Rick (MVP - Excel)


"Eddie_SP" wrote in message
...
Yep Jacob !

It's the name of the first Sheet (Sheet1).

"Jacob Skaria" wrote:

As per your code PEDIDOS should be a worksheet object; declared in the
general module..Is it so???

If this post helps click Yes
---------------
Jacob Skaria


"Eddie_SP" wrote:

Have just started working with comboboxes and listboxes.

I have a worksheet with codes in column A and details of each code in
the
other columns.

In my UserForm I have this Combobox1 that will have the values of
column A
(RowSource) and many listboxes, each one for each column (B, C, D,
etc).

I'm using the code below:

Private Sub ComboBox1_Click()
Dim ComboCode As String
ComboCode = Application.WorksheetFunction.VLookup(ComboBox1.Va lue,
PEDIDOS.Range("A6:J2000"), 2, 0)
ListBox1.Value = ComboCode
End Sub

But it "requires an object".

Can anyone help me?

Thank you in advance.