Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Retriving data in a userform from a excel sheet

  Asked By: Jaxson    Date: Sep 29    Category: MS Office    Views: 5201
  

How do I Retrive data in userform from Excel Sheet.

In a Userform, I Have combobox containing Customer Code. Now How do I
retreive the name of the cusotmer in Textbox1 upon selection made from
combobox.

Its something like using the Vlookup in VBA.

Share: 

 

5 Answers Found

 
Answer #1    Answered By: Ivan Coleman     Answered On: Sep 29

Where is the name of the customer  kept?

 
Answer #2    Answered By: Jet Brown     Answered On: Sep 29

It's in the Sheets "Customer Master"

Column 1 contains the customer  Code
Column 2 contains the Name of the customer

And in a form I am asking the user to select the customer Code and upon
which the Name of the customer should reflect in Textbox.

 
Answer #3    Answered By: Ludkhannah Fischer     Answered On: Sep 29

did you ever get this to work? I am trying to do almost
the exact same thing (see my question "Searching Excel from Word"),
but am really strugling getting it to work. Any info you received
that you could pass on to me would be much appreciated.

 
Answer #4    Answered By: Sairish Kauser     Answered On: Sep 29

Private Sub CboNodeid_Change()
With TxtNodeDescription
If CboNodeid.Value = "" Then
TxtNodeDescription.Value = ""
Else
TxtNodeDescription.Value = Application.VLookup(CboNodeid.Value,
Range("nodedetails"), 3, False)
End If
End With
End Sub

this is my code  to do the same

 
Answer #5    Answered By: Javairea Akram     Answered On: Sep 29

thanks for sharing how you do it, but I still can't get it to work. The
only other code  I have are the two lines below:

Dim myWB As Excel.Workbook
Set myWB = GetObject("D:\AORP Project\Form vlookup  Example.xls")

With the 2 statements above, I can reference a cell with the statement below
and it works great.

MsgBox myWB.Worksheets("Sheet1").Range("A2").Value

However, as soon as I try the application.vlookup....I get a run time error.
What am I missing? It has to be something very simple, but I am lost.

A perfect example of what I am trying to do is simply take the very simple
"Form VLookup Example.xls" file that contains about 5 lines of code located on
the Excel Group and make it work with a Word Userform instead of an Excel
Userform.

 
Didn't find what you were looking for? Find more on Retriving data in a userform from a excel sheet Or get search suggestion and latest updates.




Tagged: