+ Reply to Thread
Results 1 to 11 of 11

VBA Lookup from List and output Userform textbox in adjacent cell

  1. #1
    Registered User
    Join Date
    11-26-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    95

    Unhappy VBA Lookup from List and output Userform textbox in adjacent cell

    Hi I have looked on the forum for this, but can't seem to find what I want.

    This is a basic formula or what needs to happen.

    If x is in y then
    show q in v

    X - Is a postcode in a dataset on a tab
    Y - is on a seperate tab and is a list of all relevant postcodes.
    Q - is the txtbox field on a userform
    V - is the adjacenet cell to X (offset,1)

    Ideally I would like for it to loop through each cell on the list which has different rows each month.

    I'm using the below, but its a bit clumsey.

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    11-26-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    95

    Re: VBA Lookup from List and output Userform textbox in adjacent cell

    Think I might have done it.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-26-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    95

    Re: VBA Lookup from List and output Userform textbox in adjacent cell

    Actually the Lookup Cell is a Concate of 2 cells. Can someone please advise why the below is not working. The Cell is offset by 4 and needs to be added to the current cell that is being looked up.
    Its the part in Bold that is not working.


    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-16-2016
    Location
    NC
    MS-Off Ver
    2007, 2019
    Posts
    86

    Re: VBA Lookup from List and output Userform textbox in adjacent cell

    "Dim sal" ???

  5. #5
    Registered User
    Join Date
    11-26-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    95

    Re: VBA Lookup from List and output Userform textbox in adjacent cell

    What do you mean?

  6. #6
    Registered User
    Join Date
    11-16-2016
    Location
    NC
    MS-Off Ver
    2007, 2019
    Posts
    86

    Re: VBA Lookup from List and output Userform textbox in adjacent cell

    I don't see in your code where you have Dimensioned the variable "sal".

    Dim sal AS ???

  7. #7
    Registered User
    Join Date
    11-16-2016
    Location
    NC
    MS-Off Ver
    2007, 2019
    Posts
    86

    Re: VBA Lookup from List and output Userform textbox in adjacent cell

    This is as far as I can get cuz I don't have the rest of your project. The text is RED are the changes I made to correct error messages here.

    I may have missed one or two ...



    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    11-26-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    95

    Re: VBA Lookup from List and output Userform textbox in adjacent cell

    The code works fine, the issue is the following line of code

    Please Login or Register  to view this content.
    What I want to happen here is to concatenate the current cell with a cell offset by 1 and this value appear in FindZone.

  9. #9
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: VBA Lookup from List and output Userform textbox in adjacent cell

    What you need is
    Please Login or Register  to view this content.
    Additionally, I would suggest this approach
    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  10. #10
    Registered User
    Join Date
    11-26-2014
    Location
    London
    MS-Off Ver
    2013
    Posts
    95

    Re: VBA Lookup from List and output Userform textbox in adjacent cell

    Perfect. Thank you xlnitwit as the Irish would say that works like a charm. Thank you for simplifying my code as well. Really appreciated.

  11. #11
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: VBA Lookup from List and output Userform textbox in adjacent cell

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Loop: IF cell is not blank then output adjacent cell
    By dchubbock in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-20-2016, 12:58 PM
  2. UserForm: Textbox value load according to drop down list
    By lazyserv in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-31-2015, 05:00 PM
  3. Userform textbox output to one decimal place
    By Tubes2015 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-18-2015, 11:12 AM
  4. Userform List of Textbox names
    By Isaaq in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-27-2014, 10:28 AM
  5. [SOLVED] Vlookup through 3 sheets from one lookup value result in all textbox in userform vba
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-11-2014, 05:17 AM
  6. Replies: 2
    Last Post: 02-08-2014, 01:24 PM
  7. [SOLVED] Code to list cells with adjacent blank cell in userform listbox.
    By Nitefox in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 6
    Last Post: 12-24-2013, 10:27 PM

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