+ Reply to Thread
Results 1 to 5 of 5

VLOOKUP Funtion within a User Form

  1. #1
    Registered User
    Join Date
    02-20-2005
    Posts
    53

    VLOOKUP Funtion within a User Form

    Hi All
    I have user form that I use to imput data in a worksheet from Job report forms from Engineers.
    I want to put a text box with code on the user form which will read from a combo box on the user form (which will have a venue) and vlookup a code form a list in the workbook which include all venues along with there own code.
    Hope this makes sense, basically some code on a user form to read from a combo box to give a code number.

    Any help please

    Bern

  2. #2
    Registered User
    Join Date
    02-20-2005
    Posts
    53

    reply

    Hi All
    Due to the limited response to my query perhaps I can just try to explain further what I am trying to achieve.
    In my user form I have a combo box (Venue) from which I can choose from up to a hundred different venues. Each of these venues has differing codes for pricing purposes. I.e. Birmingham is in code A or Southampton is a code C...

    In another combo box (Band Code) I have a choice of call types i.e. A7 which is the venue code and the number of hours to respond.
    There could be up to hundred venues which are all coded either A, B, C, D.

    I would like a box to give me the code for that venue in a separate box so I can choose the appropriate code in the Band code
    The code would read something like =Vlookup Venue, Codes, 2
    But I cannot seem to implement it or where? (Codes being a list of venues and band codes in the worksheet)

    Any Help please
    Bern

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Lightbulb

    Hi, I was not able to get a Vlookup to work in a userform such as selecting from a comboBox and the value showing up in a textbox using VBA,
    But I thought of another alternative,
    attatched you will see an example
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    02-20-2005
    Posts
    53

    reply

    Hi Dave
    Thanks for the reply, I used the code you sent, it worked great, its just that the form I use, the details goes into separate sheets so it proved difficult, in the end I decided to put a list of codes into my form and will read them from there.

    Again many thanks for assistance
    Bern

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524

    Re: VLOOKUP Funtion within a User Form

    Quote Originally Posted by davesexcel View Post
    Hi, I was not able to get a Vlookup to work in a userform such as selecting from a comboBox and the value showing up in a textbox using VBA,
    But I thought of another alternative,
    attatched you will see an example
    Edit: Cleaned up code, uses Vlookup in VBA, replace it with the combobox code.

    Please Login or Register  to view this content.

+ 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