+ Reply to Thread
Results 1 to 9 of 9

userform textbox to hold and add to existing data

  1. #1
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    userform textbox to hold and add to existing data

    Hi, I have this userform with a textbox16 on the "add case" tab. What im hoping to achieve is for this textbox to hold on to data that has been added to it when the "Add" command is clicked. For example, after filling in the info in combobox6, textbox 6 and 15, clicking "Add" will add those info into textbox16 and clear the info from combobox6 and textbox6 and 15. Repeating this process should not clear what has been previously entered into textbox16. Ultimately, textbox16 should look like this:

    Body part X1234 M5678
    Muscle X2345 M7890
    Tooth X3456 M1232

    I do not know if this is possible, but any help would be appreciated. Attached is the workbook for your reference
    Attached Files Attached Files

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: userform textbox to hold and add to existing data

    Something like

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: userform textbox to hold and add to existing data

    Thank you mike. How do I make it such that it goes into a line break after each time it executes?

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: userform textbox to hold and add to existing data

    What do you mean "goes into a line break". The code I posted puts the a linebreak before the new line in the text box.

  5. #5
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: userform textbox to hold and add to existing data

    this is how it looks like after clicking the command button. Can the second entry go into another line instead of continuing in the same line?
    Attached Images Attached Images

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: userform textbox to hold and add to existing data

    It looks like you need to set the TextBox's .MultiLine property to True.

  7. #7
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: userform textbox to hold and add to existing data

    Thanks mike, that solved the issue. One question, is it possible to have the different lines in that textbox go into different rows on the worksheet?

  8. #8
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: userform textbox to hold and add to existing data

    Yes. If you want the text box values to go into A1 and downward


    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    05-06-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    361

    Re: userform textbox to hold and add to existing data

    Thanks mike! I have problems making the code work in the actual workbook that I have, but will post another thread so that this one doesn't go off topic. I hope you will be able to help me again there thread link as below

    http://www.excelforum.com/showthread...78#post4490378

+ 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. Replies: 0
    Last Post: 08-18-2015, 04:13 PM
  2. [SOLVED] VBA, Userform to dispaly the data existing in cells upon openining the userform
    By DCC_PD in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-27-2015, 10:39 AM
  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. Replies: 4
    Last Post: 01-29-2014, 05:53 AM
  5. 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
  6. [SOLVED] Using a Calendar Control within a Userform with an invisible textbox to hold value select
    By Orestees in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-11-2012, 03:40 PM
  7. 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

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