+ Reply to Thread
Results 1 to 7 of 7

CheckBox To Disable TextBoxes

  1. #1
    Registered User
    Join Date
    07-15-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    77

    CheckBox To Disable TextBoxes

    Hi All

    I have found plenty of posts to enable text boxes through a check box but not the other way round. Can anyone help?

    If checkbox "chkHomeNumber" is enabled then I would like to disable textbox "TextBoxHomeNumberSTD" & "TextBoxMain"

    Below is code that works perfectly but there is no alternative disabled option in VBA code that I can see.

    Please Login or Register  to view this content.
    Also is it possible to ignore part of a macro when the checkbox is activated or will i have to run a slightly altered macro from that checkbox activation?

    Thanks
    Mark
    Last edited by markrennolds; 03-30-2010 at 03:13 PM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: CheckBox To Disable TextBoxes

    Not sure what you mean by "Enabled" when you refer to your checkbox

    Is this what you need?

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-15-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    77

    Re: CheckBox To Disable TextBoxes

    Thanks Marcol

    That is what was needed, just flipped round the true & false.

    Also when the checkbox is checked is there a way of omitting part of a macro or would I need to run another macro that was slightly altered from the original macro. I ask as the code refers to the 2 text boxes that have been disabled as above?

    This is the part of the code to omit if possible:

    Please Login or Register  to view this content.
    Full Code is:


    Please Login or Register  to view this content.

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: CheckBox To Disable TextBoxes

    Try

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-15-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    77

    Re: CheckBox To Disable TextBoxes

    Hi

    Unfortunately that didnt work. It still brings up message box for no phone number being entered (as per macro).

    Thanks
    Mark

  6. #6
    Registered User
    Join Date
    07-15-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    77

    Re: CheckBox To Disable TextBoxes

    apologies, all corrected now. I had to change value of text box so was automatically enabled.

    This has resolved the issue.

    Many Thanks
    Mark

  7. #7
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: CheckBox To Disable TextBoxes

    Glad to have helped

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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