+ Reply to Thread
Results 1 to 11 of 11

VBA userform Textbox vloolup function

  1. #1
    Forum Contributor
    Join Date
    02-22-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    108

    Angry VBA userform Textbox vloolup function

    Hi,

    I have a system login userform where the user should enter his username and pass word.

    Now i have added a textbox userid so i have a code with a vlookup function that needs to place the userid in a textbox on the username textbox exit event?

    Nothing happens on the exit event i'm not sure if it has got to do with text mixing with numbers.

    Below is the code can some advise me where my problem is?
    Please note that all is textboxes

    Please Login or Register  to view this content.
    Aslo below is the the range i'm using for the users data.
    A B C
    Usename Password User ID
    jan1 Miles1 Kal B01
    jan2 Miles2 Kal B02
    jan3 Miles3 Kal B03
    jan4 Miles4 Kal B04
    jan5 Miles5 Kal B05

  2. #2
    Forum Contributor
    Join Date
    02-22-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: VBA userform Textbox vloolup function

    No replies??

  3. #3
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: VBA userform Textbox vloolup function

    Your information is not very clear.
    What does the user id data look like? Kal or B04?

    it might be best if you can upload a workbook example.
    Regards
    Sean

    Please add to my reputation if you think i helped
    (click on the star below the post)
    Mark threads as "Solved" if you have your answer
    (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code:
    [code] Your code here [code]
    Please supply a workbook containing example Data:
    It makes its easier to answer your problem & saves time!

  4. #4
    Forum Contributor
    Join Date
    02-22-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: VBA userform Textbox vloolup function

    It is KAL B04 attached is the worksheet...

    Master Downtime Report - Copy.xlsm

  5. #5
    Forum Contributor
    Join Date
    02-22-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: VBA userform Textbox vloolup function

    Sorry wrong attachment

    Master Downtime Report V5.0.2.xlsm

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA userform Textbox vloolup function

    Why are you using Val when the username is text?
    If posting code please use code tags, see here.

  7. #7
    Forum Contributor
    Join Date
    02-22-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: VBA userform Textbox vloolup function

    Norie,

    I have tried everything even without Val it still doesn't work it is something simple but i just can't make it to work i have a vlookup function in the same workbook and it is working fine however it is a number entered and then text are been lookup...

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA userform Textbox vloolup function

    It works for me if I remove Val.

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,517

    Re: VBA userform Textbox vloolup function

    Quote Originally Posted by Hilton1982 View Post
    I have tried everything even without Val it still doesn't work ...
    It seems working for me.

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA userform Textbox vloolup function

    Hilton

    VLOOKUP will work for numbers or text, just as long as the data type of the value you are looking up matches the data type of the values you are looking in.
    Last edited by Norie; 12-03-2012 at 10:28 AM.

  11. #11
    Forum Contributor
    Join Date
    02-22-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: VBA userform Textbox vloolup function

    Thanks guys now it's working ...????

+ 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