Results 1 to 5 of 5

Populating a text box in a form based on VLOOKUP function

Threaded View

  1. #1
    Registered User
    Join Date
    03-01-2007
    Posts
    14

    Exclamation Populating a text box in a form based on VLOOKUP function

    I want to populate TextBox2 in a form with the value in TextBox1 that uses a VLOOKUP function. I have scoured the net and have come up with this.

     
    
    Private Sub TextBox1_Change() Dim rngFind As Range Set rngFind = Sheet1.[A7:J86] On Error Resume Next TextBox2.Text = WorksheetFunction.VLookup(TextBox1.Value, rngFind, 10, False) On Error GoTo 0 End Sub

    However, this does not appear to do anything. I type a string that matches a value in the lookup range, and nothing appears to happen. I have just recently acquainted myself with VB and am very green. Please tell me it is something simple I am missing.

    Thanks. B
    Last edited by VBA Noob; 03-02-2007 at 02:10 PM.

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