+ Reply to Thread
Results 1 to 10 of 10

Userform adding text box

  1. #1
    Registered User
    Join Date
    06-19-2018
    Location
    Beirut,Lebanon
    MS-Off Ver
    2017
    Posts
    25

    Userform adding text box

    Hello all,

    I have a userform that works perfectly and has several features.

    I want to add 1 textbox i forgot about.

    However i am having a tough time doing so because there are several automated cells and formulas with for and while loops.

    When you see the code you will understand what i mean. I tried shifting all text box names by 1. For example Textbox2 becomes Textbox3 and 3 becomes 4 .... And then add a new Textbox2 to integrate into the code and edit the range of while loops from (1 to 11) to (1 to 12).
    However the code is unstable and not working.

    I simply want to add 1 textbox called "Date" after "Name" and I want it to add it to the excel sheet of course.

    Any help would be great.

    This is for a client I have that might benefit from such a userform so I need it to be perfect and to submit it as soon as possible.
    Attached Files Attached Files
    Last edited by alansidman; 07-23-2018 at 09:51 AM.

  2. #2
    Forum Contributor
    Join Date
    09-21-2009
    Location
    Belgium - Mechelen
    MS-Off Ver
    Office 365 - version 2310
    Posts
    278

    Re: Userform adding text box

    You could add a textbox after the Name, and adjust the code without changing everything.

    I just added a textbox after the name textbox, named it TxtDate and adjusted the code slightly to add the value to column Y.
    There are no major adjustments.
    added a 5th val variable : val5 as a date
    Please Login or Register  to view this content.
    and added the value to a cell in column Y.
    I added code according to your code
    Please Login or Register  to view this content.
    I uploaded the adjusted file.

    hope this helps.
    Attached Files Attached Files
    Even a little help can be a big help !!
    1. A sample workbook says more then words. Add problem description and solution so we can understand the problem.
    2. Your appreciation is accepted by clicking the star "Add Reputation" at the lower left of the post.
    3. If your problem is solved, mark it as [SOLVED]: See "FAQ : " https://www.excelforum.com/faq.php
    4. Use [CODE] [/CODE] tags to illustrate your code: see here

  3. #3
    Registered User
    Join Date
    06-19-2018
    Location
    Beirut,Lebanon
    MS-Off Ver
    2017
    Posts
    25

    Re: Userform adding text box

    Dear MarMo

    A sincere thank you for taking the time to help. However, i was able to add a date textbox like you did.

    But it is not enough because I want the "Date" box to be also used in the other features. When i search for a previously entered client, I couldnt get the date to show in the form and to be edited.

    And as a final request, is it possible that the date value be inserted in the sheet right after name? Without ruining the code.

    Thank you again and any help would be much appreciated.

  4. #4
    Forum Contributor
    Join Date
    09-21-2009
    Location
    Belgium - Mechelen
    MS-Off Ver
    Office 365 - version 2310
    Posts
    278

    Re: Userform adding text box

    Made some small adjustments.
    Pls try the userform and see if it meets your requirements.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-19-2018
    Location
    Beirut,Lebanon
    MS-Off Ver
    2017
    Posts
    25

    Re: Userform adding text box

    Exactly what i need!

    Thank you very much Marmo

  6. #6
    Registered User
    Join Date
    06-19-2018
    Location
    Beirut,Lebanon
    MS-Off Ver
    2017
    Posts
    25

    Re: Userform adding text box

    Hello Mr MarMo

    I was just checking the file again. And I think there is something wrong.

    First, what is the format of the date that should be entered?

    Second, If i type June 2018, it works. But then if i want to amend it, i type november 2018, it changes to 22-june-1905 for example.

    Try amending a date and you will see it.

    Sorry again but if i can get this to work i am done!

  7. #7
    Registered User
    Join Date
    06-19-2018
    Location
    Beirut,Lebanon
    MS-Off Ver
    2017
    Posts
    25

    Re: Userform adding text box

    I was just checking the code again and I think the amend option is not working. I have a previous version V4 without the date column and it works perfectly however the amed no longer works in V5 (After adding the date)

  8. #8
    Forum Contributor
    Join Date
    09-21-2009
    Location
    Belgium - Mechelen
    MS-Off Ver
    Office 365 - version 2310
    Posts
    278

    Re: Userform adding text box

    In what format must the date be ?

    mm/dd/yyyy
    dd/mm/yyyy
    other ..... ?

    pls, upload the WB with the wrong data, and add comments pls in the WB
    I'll try to look at it ASAP !

    grtz

  9. #9
    Registered User
    Join Date
    06-19-2018
    Location
    Beirut,Lebanon
    MS-Off Ver
    2017
    Posts
    25

    Re: Userform adding text box

    dd/mm/yyyy is good

    or

    mmmm dd yyyy (July 28 2018)

    I added some comments in the active sheet not in the code

    thanks again!!
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    09-21-2009
    Location
    Belgium - Mechelen
    MS-Off Ver
    Office 365 - version 2310
    Posts
    278

    Re: Userform adding text box

    Amend button adjusted, and date format is still dd/mm/yyyy.
    The amend code was not updated before, because i thought you where going to do this.

    You'll find your new WB with adjusted code.
    Pls test it and let me know if it works.

    Kind regards
    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. [SOLVED] Adding value to the text field in userform based on the Calenndar UserForm
    By Szwadron6 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-26-2017, 11:26 AM
  2. [SOLVED] Adding text in addition to value when pulling data from userform
    By adrenom in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-28-2016, 10:39 AM
  3. [SOLVED] UserForm - adding exception to text box restrictions (numbers only)
    By DHFE in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-21-2015, 02:50 AM
  4. [SOLVED] Wrong result adding values of text boxes in a userform.
    By MariaPap in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-27-2014, 09:46 AM
  5. [SOLVED] Adding text to sheet from userform
    By Nitefox in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 3
    Last Post: 01-12-2014, 11:26 PM
  6. Adding text to a table via a macro or userform
    By h.maleki in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-30-2012, 10:12 PM
  7. Adding text boxes in userform
    By jcarstens in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-10-2009, 02:23 AM

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