+ Reply to Thread
Results 1 to 7 of 7

Checkbox to disable textbox

  1. #1
    Forum Contributor
    Join Date
    12-30-2009
    Location
    US
    MS-Off Ver
    Excel 2003, 2010, 2016, 2019, & Office 365
    Posts
    194

    Checkbox to disable textbox

    Not sure what I'm doing wrong. Seems like it should say: When the form initializes and CheckBox1 is True then TextBox1 is not visible...

    Please Login or Register  to view this content.
    Last edited by Rick-O-Shay; 07-03-2020 at 06:52 PM.

  2. #2
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: Checkbox to disable textbox

    I don't think controls have any value while the form is loading. Try moving your code to the UserForm's Activate event.

    By the way, your two lines of code can be replaced by this single line of code...
    Please Login or Register  to view this content.
    Last edited by Rick Rothstein; 07-03-2020 at 05:53 PM.

  3. #3
    Forum Contributor
    Join Date
    12-30-2009
    Location
    US
    MS-Off Ver
    Excel 2003, 2010, 2016, 2019, & Office 365
    Posts
    194

    Re: Checkbox to disable textbox

    Hmm, Still no. I'm wondering if it is related to how I built my form. I have my UserForm, with a FrameBox, and my TextBox and CheckBox on top.

  4. #4
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: Checkbox to disable textbox

    Can you post your workbook (remove any sensitive data first though)? If so, read the yellow banner at the top of this forum's window to see how you have to do it.

  5. #5
    Forum Contributor
    Join Date
    12-30-2009
    Location
    US
    MS-Off Ver
    Excel 2003, 2010, 2016, 2019, & Office 365
    Posts
    194

    Re: Checkbox to disable textbox

    On the Input Data Button, on the form I built, I just want check boxes to disable the fields.
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: Checkbox to disable textbox

    This appears to be a different question than you originally asked. To so what you are now asking for, you will have to put code in each CheckBox's Click event. Here are the first two such event procedures... you have to do similar for the remaining CheckBoxes (make sure match the CheckBox number to the TextBox number)...
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-30-2009
    Location
    US
    MS-Off Ver
    Excel 2003, 2010, 2016, 2019, & Office 365
    Posts
    194

    Re: Checkbox to disable textbox

    Ah Perfect! Sorry if I was unclear. I knew I would have to do it for each Checkbox/TextField. Sorry, I'm still stumbling my way around VBA via this forum, you tube, and google searches.

    Thank you! Have a great evening.

+ 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. If checkbox is checked, disable the cells
    By olga6542 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2019, 04:43 PM
  2. Disable ActiveX checkbox based on Value
    By hnguy71 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2018, 01:04 PM
  3. IF statement to enable/disable a checkbox in userform?
    By cameronyoung in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-31-2013, 12:18 PM
  4. [SOLVED] Disable a row based on a checkbox
    By talochka in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-01-2013, 01:11 PM
  5. Disable combobox from checkbox...?
    By hanifYP in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-01-2013, 01:59 AM
  6. checkbox or option box to disable cell
    By hitch35 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-02-2011, 02:32 AM
  7. CheckBox To Disable TextBoxes
    By markrennolds in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-30-2010, 03:42 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