+ Reply to Thread
Results 1 to 4 of 4

VBA Excel If Then Statement doesn't "undo" when user corrects selected option

  1. #1
    Forum Contributor
    Join Date
    10-25-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    292

    VBA Excel If Then Statement doesn't "undo" when user corrects selected option

    I have the following code in my UserForm and as I test it I notice it works correctly when the user selects Employee, but if I decide I had made a mistake and select a different option within the drop-down box, it doesn't clear the list of fields in the Array section and enable the user to input information. All of those fields remain .Enabled = False and with a value of *****.

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    09-26-2012
    Location
    Chesterfield, England
    MS-Off Ver
    MS Office 2010
    Posts
    12

    Re: VBA Excel If Then Statement doesn't "undo" when user corrects selected option

    I'm by no means an expert and am actually learning VBA myself. I figure however that one of the best ways to learn is to try and problem solve so I'm having a look through the forum for simple problems I can have a bash at.

    From what I can tell, you have no 'else' condition here that will trigger the fields to change if the user selects anything other than "Employee" i.e. if I select "Employee", the code fires and populates all the fields with "*****" and then sets .Enabled = False.

    If I then change the selection, nothing is set up to trigger anything different. I guess I would expect it to look like this:-

    Please Login or Register  to view this content.
    Hope this helps.

    Danny
    Last edited by Danny_; 11-26-2012 at 07:08 PM.

  3. #3
    Forum Contributor
    Join Date
    10-25-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    292

    Re: VBA Excel If Then Statement doesn't "undo" when user corrects selected option

    Thank you Danny for your response. I will give that a try. I am concerned that I have three options the user can choose. Employee, Agency, or External. So, hopefully, the else allows one of the other two to be selected withouth messing anything up. I will give it a try this morning. Thank you!

  4. #4
    Forum Contributor
    Join Date
    10-25-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    292

    Re: VBA Excel If Then Statement doesn't "undo" when user corrects selected option

    Yes! That did it! Thank you VERY much! Excellent work!

+ 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