Results 1 to 4 of 4

VLookup in UserForm VBA issues

Threaded View

  1. #1
    Registered User
    Join Date
    09-03-2013
    Location
    United States
    MS-Off Ver
    Office 2010
    Posts
    3

    VLookup in UserForm VBA issues

    Hello All,

    I'm a self-taught VBA novice (thanks to excellent sites such as Mr. Excel) and I am working on creating a GUI for a spreadsheet I've been keeping of units my team ships out. In my spreadsheet, I have a formula that performs a Vlookup for the model number of a unit shipped if the part number is entered. This formula looks at a different worksheet and returns the values requested. I'm trying to translate this into the VBA Userform but keep getting the 1004 error and Excel keeps crashing. Maybe you guys could help me out? Here's the code I'm working with:

    Private Sub CompanyPN_AfterUpdate()
    'Transfer is a global variable, defined as a range
    With Application.WorksheetFunction
        Transfer.Value = .VLookup(CompanyPN.Value, ThisWorkbook.Worksheets("Table of Loggers").Range("A:B"), 2, False)
    End With
    
    ModelNumber.Value = Transfer.Value 'untested, want to get the VLookup to work first
    
    End Sub
    Basically, I have a text field called CompanyPN where I'm entering my part number. I want to populate another text field, ModelNumber, based on these results in my UserForm. Please help if you can!

    Thanks,
    Alex
    Last edited by wanamaa; 09-04-2013 at 12:23 PM. Reason: Figured out how to do what I wanted to do

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. UserForm-Listbox-Issues, Data To & From Excel Cells Not Working; Null Values
    By Kalithro in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-16-2013, 12:43 AM
  2. userform.show issues
    By ag273n in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-30-2013, 11:47 PM
  3. USERFORM - Issues Log Template
    By kaurka in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-26-2013, 09:50 AM
  4. Listbox Issues / Errors with UserForm
    By Chris270 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-04-2012, 07:14 AM
  5. Userform filter issues
    By kryt0n in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-22-2010, 10:06 AM

Tags for this Thread

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