+ Reply to Thread
Results 1 to 28 of 28

textbox visibility based on specific text/word of other textbox

  1. #1
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Talking textbox visibility based on specific text/word of other textbox

    suppose in my UserForm there have 3 text box, in Textbox1 i can write anything, like: Apple, Ball, Cat, 01-Jan-2019, ect. anything...
    if I write Cat then Textbox2 & Textbox3 will be visible and able to write anything like: Apple, Ball, Cat, 01-Jan-2019
    how can i do that?
    TIA
    Last edited by emmr; 07-31-2019 at 02:49 AM.

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: textbox visibility based on specific text/word of other textbox

    Assuming you want TextBox 2 & 3 to appear when TextBox1 is not empty and disappear when it is, you could use this:
    Please Login or Register  to view this content.
    BSB

  3. #3
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Re: textbox visibility based on specific text/word of other textbox

    tnx a lot, its solved

  4. #4
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Re: textbox visibility based on specific text/word of other textbox

    suppose in my UserForm there have 3 text box, in Textbox1 i can write anything, like: Apple, Ball, Cat, 01-Jan-2019, ect. anything...
    if I write Cat in textbox1 then Textbox2 & Textbox3 will be writable other wise that textbox remain non writable,
    how can i do that?
    TIA

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,944

    Re: textbox visibility based on specific text/word of other textbox

    You said this was solved ...
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: textbox visibility based on specific text/word of other textbox

    Maybe this?
    Please Login or Register  to view this content.
    BSB
    Last edited by BadlySpelledBuoy; 07-31-2019 at 01:28 PM.

  7. #7
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Re: textbox visibility based on specific text/word of other textbox

    AliGW: after getting the solution im saying this as solved

    BadlySpelledBuoy: this code is not working, could u plz help with other code, tnx

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,944

    Re: textbox visibility based on specific text/word of other textbox

    But you are still asking for help, so you should remove the solved tag until you have received that help, otherwise members may not look at the thread.

  9. #9
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Re: textbox visibility based on specific text/word of other textbox

    did it, tnx for your support,

    suppose in my UserForm there have 3 text box, in Textbox1 i can write anything, like: Apple, Ball, Cat, 01-Jan-2019, ect. anything...
    if I write Cat in textbox1 then Textbox2 & Textbox3 will be writable other wise that textbox remain non writable,
    how can i do that?
    TIA

  10. #10
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: textbox visibility based on specific text/word of other textbox

    Quote Originally Posted by emmr View Post
    BadlySpelledBuoy: this code is not working, could u plz help with other code, tnx
    Can you be a bit more specific about what "not working" means?

    Is there an error message? If so, what does it say?
    Does it not do what you need? If so, you need to give more detail on exactly what you want it to do.

    BSB

  11. #11
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Re: textbox visibility based on specific text/word of other textbox

    BadlySpelledBuoy Sir: visible is working at my tool, textbox2 & textbox3 visible only for a specific word "Cat" at textbox1,

    now i'm looking for other option that, all textbox will be visible all time but after writing "Cat" at textbox1 only, i'll be able to write anything at textbox2 & textbox3 other that "Cat" that textbox will be non writable.
    Tnx

  12. #12
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: textbox visibility based on specific text/word of other textbox

    So if TextBox1 says "Cat" then TextBox2 and TextBox3 will be active and can have any value typed in. But if TextBox1 does not say "Cat" then the other textboxes will be locked from editing?

    BSB

  13. #13
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Re: textbox visibility based on specific text/word of other textbox

    yes sir, im expecting just like this

  14. #14
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: textbox visibility based on specific text/word of other textbox

    Then maybe this?
    Please Login or Register  to view this content.
    BSB

  15. #15
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: textbox visibility based on specific text/word of other textbox

    Re your PM ("sir im sry to inform you, this code is not working, im able to write anything anytime in textbox2 & textbox3 which is not depend on anything, looking for your next advice"), can you attach your file. It will be far easier to provide a solution if we can see that.

    BSB

  16. #16
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Re: textbox visibility based on specific text/word of other textbox

    sir this is the file
    Attached Files Attached Files

  17. #17
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Re: textbox visibility based on specific text/word of other textbox

    check the attached picture non writable pic saying that, you cant write anything there, even mouse point cant insert there,
    for specific word "passport" you can write anything there.
    Attached Images Attached Images

  18. #18
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,944

    Re: textbox visibility based on specific text/word of other textbox

    Dis you try typing cat into the box?

  19. #19
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Re: textbox visibility based on specific text/word of other textbox

    actually this is not my file, so i cant do anything, but i'm expecting like this

  20. #20
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: textbox visibility based on specific text/word of other textbox

    So what you meant all along was you want the textboxes greyed out when disabled?

    Try this:
    Please Login or Register  to view this content.
    See attached.

    BSB
    Attached Files Attached Files

  21. #21
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Re: textbox visibility based on specific text/word of other textbox

    thanks for your endless effort sir, actually color is not necessary, you cant click on that box/ you cant use your cursor/mouse pointer on that box until the word "Cat" on textbox1, that's way its look gray, tnx sir

  22. #22
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Re: textbox visibility based on specific text/word of other textbox

    sir at last i got that, what im expecting (and use your color), but not 100%
    from the beginning textbox2 & textbox3 need to be locked
    if i write a letter/word or at least a space[] on textbox1 then textbox2 & textbox3 become locked

    means when textbox1 is blank then textbox2 & textbox3 should be locked
    if i write anything other than "Cat" textbox2 & textbox3 remain locked
    and if i write "Cant" only and only then textbox2 & textbox3 will be open to write.
    but it will help me, tnx a lot for your support.

    im looking for your next help. tnx again
    Attached Files Attached Files

  23. #23
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: textbox visibility based on specific text/word of other textbox

    Then all you need to do is set the "Enabled" property to false in the VBE properties window as per the attached.

    Or you could set it during the UserForm Initialize event with the lines below:
    Please Login or Register  to view this content.
    Does that do what you need??

    BSB
    Attached Files Attached Files

  24. #24
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Re: textbox visibility based on specific text/word of other textbox

    owow tnx a lot sir, but i didn't find
    how to set it during the UserForm Initialize event with the lines below
    TextBox2.Enabled = False
    TextBox3.Enabled = False

  25. #25
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: textbox visibility based on specific text/word of other textbox

    Add this to your UserForm module:
    Please Login or Register  to view this content.
    BSB

  26. #26
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Re: textbox visibility based on specific text/word of other textbox

    tnx a lot sir, its fully done..
    sir how to get date picker option if Microsoft MonthView Control is not available in my Excel
    TIA

  27. #27
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: textbox visibility based on specific text/word of other textbox

    Quote Originally Posted by emmr View Post
    how to get date picker option if Microsoft MonthView Control is not available in my Excel
    That is a completely different questions to the one this thread has been dealing with. I'd therefore suggest starting a new thread for this question.

    BSB

  28. #28
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Re: textbox visibility based on specific text/word of other textbox

    ok sir, tnx a lot

+ 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. TextBox Visibility Issue
    By bdeepak in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-04-2018, 07:05 AM
  2. VBA Userform change textbox value based on Forecolor of a different textbox
    By joao1232 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-06-2016, 03:30 PM
  3. Display Full Text within Textbox (On A UserForm) when you hover over the textbox
    By ShakJames in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-20-2015, 09:01 AM
  4. add a string of locked text to vba textbox based on entry in the same textbox
    By yoursamrit2000 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-21-2014, 11:48 PM
  5. [SOLVED] Conditional formatting userform textbox based on textbox value
    By kidwispa in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-03-2014, 08:28 AM
  6. Set Max and Min limits on calculated textbox based on another textbox entry
    By kpinkerman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-13-2013, 04:54 PM
  7. VBA - Macro Code to copy textbox text to another worksheet textbox
    By nitram lowm in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-05-2013, 08:39 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