+ Reply to Thread
Results 1 to 2 of 2

How to autofill a textbox from a table

  1. #1
    Registered User
    Join Date
    04-30-2015
    Location
    Illinois
    MS-Off Ver
    Excel 2013
    Posts
    4

    How to autofill a textbox from a table

    I have created a form with an input textbox "POQty".
    I have a "Lot" sheet with a three column table: A=1, B=50, C=20. I have 12 rows in the table.
    If POQty is between 1 and 50, I would like "RecQty" textbox to be 20.

    I would also like "RecQty" to be read only and auto update when the "POQty" is entered.

    Thank you for your suggestions...

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,938

    Re: How to autofill a textbox from a table

    It depends on what the other rows have:

    1 50 20
    51 100 40
    101 etc...


    Then use

    Private Sub POQty_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    Me.RecQty.Value = CStr(Application.VLookup(Val(Me.POQty.Value), Worksheets("Lot").Range("A:C"), 3))
    End Sub


    Set the Enabled property of RecQty to False

    And, strictly, column B is not needed as long as column A is sorted ascending.
    Bernie Deitrick
    Excel MVP 2000-2010

+ 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. Autofill a calendar from a table
    By rami182rami in forum Excel General
    Replies: 1
    Last Post: 07-28-2014, 03:03 AM
  2. Autofill a calendar from a table
    By rami182rami in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2014, 10:54 AM
  3. Table Autofill
    By ajusheena in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-02-2013, 12:22 PM
  4. Autofill TextBox on each page of Multipage Userform
    By kimmcms in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 01-20-2013, 06:45 PM
  5. [SOLVED] Is it possible to have a command button click event autofill a textbox within a userform?
    By Orestees in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-16-2012, 02:14 PM

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