+ Reply to Thread
Results 1 to 7 of 7

Pre-input Existing data in sheet in textbox for VBA userform

  1. #1
    Registered User
    Join Date
    03-05-2020
    Location
    hong kong
    MS-Off Ver
    2016
    Posts
    4

    Pre-input Existing data in sheet in textbox for VBA userform

    hi there

    I am preparing an user form via vba and would like to show the information (SNID) from sheet1 (SNID is in column A, there there are around 1000 items) to the textbox_SNID in user form.

    Also i need to search the the SNID in the userform then i can input other items via the userform to sheet1.

    I have no idea how to do it successfully, already had a few attempts.

    thanks a lot!

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Pre-input Existing data in sheet in textbox for VBA userform

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Follow the directions in the yellow banner on top of the page.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    03-05-2020
    Location
    hong kong
    MS-Off Ver
    2016
    Posts
    4

    Re: Pre-input Existing data in sheet in textbox for VBA userform

    so here is a sample...

    For the useform, i wish that S/N: "1", SNID "155665" and "Andrew Bell" will appears on the input form textbox, and i can search other entries by their SNID.

    For column Age and City, i will input them on the user form and the result will be shown on the sheet.

    Thank you so much!
    Attached Files Attached Files

  4. #4
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Pre-input Existing data in sheet in textbox for VBA userform

    Attached the basics of an ADD/DELETE/UPDATE form, use the ListBox to search.
    Using a Table to store your data means you do not have to keep checking for size as it expands/contracts as you Add or Delete.
    Hope this helps you develop what you need, reading through the code should almost be self-explanatory.
    torachan.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-05-2020
    Location
    hong kong
    MS-Off Ver
    2016
    Posts
    4

    Re: Pre-input Existing data in sheet in textbox for VBA userform

    hi tora
    thanks for helping. however, when ever i exit the userform, the excel sheet also closed and i cannot see the vba code by pressing alt + f11

    i believe there is a way to just close the userform instead of closing the whole file.
    also i wonder if i can search through the search table by using SPID?

    thanks for the help to a new vba user.

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Pre-input Existing data in sheet in textbox for VBA userform

    Here you go.
    Attached Files Attached Files

  7. #7
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Pre-input Existing data in sheet in textbox for VBA userform

    @Bakerman, thanks, you are an early riser
    Small error, no 'txtbox45', I have corrected in the attached.
    Sorry I should not use close/save procedures when just demoing, left in from a previous coding, now removed.
    torachan.
    Attached Files Attached Files

+ 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. userform textbox to hold and add to existing data
    By bqheng in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-27-2016, 08:30 PM
  2. Transfer data from userform to macro in a module, and textbox input as numbers?
    By flabb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-13-2016, 02:25 PM
  3. Textbox must not input data if there are existing in the excel...
    By kent101 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2014, 09:16 PM
  4. List existing data in a UserForm Textbox and then be able to change the data.
    By gnaske in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-01-2013, 02:01 PM
  5. [SOLVED] Userform only to input data to Sheet only if textbox contains data/number.
    By BPSJACK in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-31-2012, 11:30 AM
  6. Edit existing data in spreadsheet through userform textbox
    By MIFF3436 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-04-2012, 12:17 PM
  7. Userform Textbox to input data to worksheet
    By wrobs in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-23-2010, 01:02 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