+ Reply to Thread
Results 1 to 2 of 2

Lookup application function in vb

  1. #1
    Registered User
    Join Date
    12-09-2011
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Excel 2007
    Posts
    46

    Lookup application function in vb

    I have a Table of names and data that goes along with the names in excel on one worksheet. Another worksheet has the same names on it but they change everyday. I would like to look at the name on the sheet that changes, find the name in the table and extract the data that goes with the name to an userform textbox. I can use the lookup function in excel but I cant seem to get the lookup application function to work in vb.

    Thanks
    Jeremy

  2. #2
    Registered User
    Join Date
    12-09-2011
    Location
    Sioux Falls, South Dakota
    MS-Off Ver
    Excel 2007
    Posts
    46

    Re: Lookup application function in vb

    This is my code but I get no result back in my textbox. Any help would be awesome!!



    Private Sub CommandButton1_Click()
    Dim res As String
    Dim dname
    Dim drange
    Dim rrange

    dname = Sheet5.range("b8").Text
    Set drange = Sheet4.range("a2:a1500")
    Set rrange = Sheet4.range("c1:c1500")

    res = Application.WorksheetFunction.Lookup(dname, drange, rrange)

    TextBox1 = res


    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1