+ Reply to Thread
Results 1 to 12 of 12

hidden or not the text box By checking a checkbox

  1. #1
    Forum Contributor
    Join Date
    06-23-2012
    Location
    tehran,iran
    MS-Off Ver
    Excel 2010
    Posts
    179

    hidden or not the text box By checking a checkbox

    Dear all
    in my work sheet I need to Hide & Unhide some text box By checking a checkbox
    it means if user mark the check box the text box will be appear & if uncheck it the text box will be hidden
    could you please help me in this case
    thanks in advanced
    Attached Files Attached Files
    Last edited by pedjvak; 06-30-2014 at 01:15 AM.

  2. #2
    Registered User
    Join Date
    08-12-2013
    Location
    Denton, Texas
    MS-Off Ver
    Excel 2010
    Posts
    89

    Re: hidden or not the text box By checking a checkbox

    If CheckBox1.Value = False Then
    TextBox1.Visible = False
    ElseIf CheckBox1.Value = True Then
    TextBox1.Visible = True
    End If

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: hidden or not the text box By checking a checkbox

    Hi, jquintana83,

    please refer to the Forum Rules and put code-tags aorund when posting procedures or longer samples as requested by Forum Rule #3.

    @pedjvak
    Thread is a duplicate to http://www.excelforum.com/excel-form...check-box.html.

    Please do not post the same question into different subforums as requested by Forum Rule #5.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Forum Contributor
    Join Date
    06-23-2012
    Location
    tehran,iran
    MS-Off Ver
    Excel 2010
    Posts
    179

    Re: hidden or not the text box By checking a checkbox

    thanks Jquintana83
    at first I am new in excel so could you plz type your code completly
    and in my work sheet I have some text box which linked to the cells in the other sheet(hidden) so in your code how I can named it
    it means instead of textbox1 what I can type(the name of group of textboxes)

  5. #5
    Forum Contributor
    Join Date
    06-23-2012
    Location
    tehran,iran
    MS-Off Ver
    Excel 2010
    Posts
    179

    Re: hidden or not the text box By checking a checkbox

    I attached a sample file
    if you could plz fix it in my file
    thanks in advanced

  6. #6
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: hidden or not the text box By checking a checkbox

    Hi pedjvak,

    Check the attached file and hope this will help you.

    SAMPLE.xlsm


    Regards,
    Paresh J
    Click on "* Add Reputation" as a way to say thanks

  7. #7
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: hidden or not the text box By checking a checkbox

    Actually, it can be written much simpler. No need for If..ElseIf, etc.

    Please Login or Register  to view this content.
    If you are pleased with a member's answer then use the Star icon to rate it.

  8. #8
    Forum Contributor
    Join Date
    06-23-2012
    Location
    tehran,iran
    MS-Off Ver
    Excel 2010
    Posts
    179

    Re: hidden or not the text box By checking a checkbox

    dear my friend it is not working

  9. #9
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: hidden or not the text box By checking a checkbox

    Hi,

    Check the attachment in post #6.


    Regards,
    Paresh J

  10. #10
    Forum Contributor
    Join Date
    06-23-2012
    Location
    tehran,iran
    MS-Off Ver
    Excel 2010
    Posts
    179

    Re: hidden or not the text box By checking a checkbox

    Dear pareshj
    I download your file but when open it and then enable the macro suddenly the check box was disappeared
    please check your file and advise me
    thanks

  11. #11
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: hidden or not the text box By checking a checkbox

    Hi,

    I have checked it. It is working fine at my end. I would suggest you to download the file. Save it on some location on your disk and then try to open it and click enable the content. Then try to check it out.


    Regards,
    Paresh J

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

    Re: hidden or not the text box By checking a checkbox

    The file attached to the OP is and .xlsx file. All the "controls" are rectangles.

    One has to assign a macro to shapes if they are to act like buttons. It will have to be an .xlsm file.
    The attached has this code.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mikerickson; 06-30-2014 at 02:42 AM.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

+ 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. Need help on checking checkbox from Infragistics WedDataGrid
    By rkey in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-30-2014, 10:45 AM
  2. Restoring defaults when UN-checking a userform checkbox
    By VBA FTW in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-12-2012, 08:52 PM
  3. protect contents of cell after checking checkbox
    By carlossaltz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-15-2008, 11:16 AM
  4. checking for hidden columns
    By stickandrock in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-21-2005, 12:00 PM
  5. Checking the status of a checkbox in a user form
    By Peter Rooney in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-01-2005, 04:09 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