+ Reply to Thread
Results 1 to 10 of 10

Userform Behaviour

  1. #1
    Forum Contributor
    Join Date
    06-06-2012
    Location
    Toronto, ON
    MS-Off Ver
    Office 365
    Posts
    138

    Userform Behaviour

    Hello,

    Ill post my simple code below - what Im really wondering is how I would do this (if its even possible)...Im using a userform and I have two checkboxes, a 'Yes' and 'No'..........Im wondering if the 'Yes' is checked I would like the userform to extend and another question to appear on the userform. If the No is checked, then the form doesnt have to do anything.

    So this is what I got - was hoping someone could tell me how to make that happen, if its possible.

    Thanks



    Please Login or Register  to view this content.
    Last edited by excelenergy; 07-07-2014 at 02:47 PM.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Userform Behaviour

    This is very simple.

    All you have to do is to create your additional text boxes etc and modify their properties to make them invisible.

    If you select yes then your code should then make them visible.

  3. #3
    Forum Contributor
    Join Date
    06-06-2012
    Location
    Toronto, ON
    MS-Off Ver
    Office 365
    Posts
    138

    Re: Userform Behaviour

    Didnt think of that. Ill give that a shot!

    Thanks for your help. Ill post here if I have any further questions.

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Userform Behaviour

    This is very simple.

    All you have to do is to create your additional text boxes etc and modify their properties to make them invisible.

    If you select yes then your code should then make them visible.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    06-06-2012
    Location
    Toronto, ON
    MS-Off Ver
    Office 365
    Posts
    138

    Re: Userform Behaviour

    The only thing Im in a bind with now is I need the command buttons to drop down to. At the end of the form I have a 'submit' button.

    So I need those to move down as well. And right now I cant get it to. Any suggestions on that?

    Quote Originally Posted by mehmetcik View Post
    This is very simple.

    All you have to do is to create your additional text boxes etc and modify their properties to make them invisible.

    If you select yes then your code should then make them visible.

    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Userform Behaviour

    Move your button to the top. It is easier that way.

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Userform Behaviour

    I enhanced mehmetcik example file.

    You can change the position of controls within the Resize event.
    Because the form now has a button present you need to toggle the visibility of the controls.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  8. #8
    Forum Contributor
    Join Date
    06-06-2012
    Location
    Toronto, ON
    MS-Off Ver
    Office 365
    Posts
    138

    Re: Userform Behaviour

    Fantastic! That worked beautifully!

    Exactly what I needed. Really interesting though! Ive never done anything quite like this so it was neat to see how it could be done. The only thing I saw online was adding a class module and 1000 lines of code, and as you can imagine I decided against that haha!

    Thanks andy!




    Quote Originally Posted by Andy Pope View Post
    I enhanced mehmetcik example file.

    You can change the position of controls within the Resize event.
    Because the form now has a button present you need to toggle the visibility of the controls.

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    06-06-2012
    Location
    Toronto, ON
    MS-Off Ver
    Office 365
    Posts
    138

    Re: Userform Behaviour

    Hey Andy,

    I was just noticing this worked properly - except one thing. The first textbox at the top of my user form isnt aligned with the text on the left anymore...The text on the left is
    "Name" < then textbox1 here >

    after implementing this code it's moving the textbox so it looks more like this:

    "Name:"


    <textbox1 is down here>

    Any ideas why that could be? Other than that - everything works perfectly.


    Quote Originally Posted by excelenergy View Post
    Fantastic! That worked beautifully!

    Exactly what I needed. Really interesting though! Ive never done anything quite like this so it was neat to see how it could be done. The only thing I saw online was adding a class module and 1000 lines of code, and as you can imagine I decided against that haha!

    Thanks andy!

  10. #10
    Forum Contributor
    Join Date
    06-06-2012
    Location
    Toronto, ON
    MS-Off Ver
    Office 365
    Posts
    138

    Re: Userform Behaviour

    Hey Andy,

    Dont worry, I fixed it, I had to set this right here:
    Please Login or Register  to view this content.
    Doing that, it made sure it was all re-aligned.

+ 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. Replies: 5
    Last Post: 02-27-2013, 12:04 PM
  2. Tabbing throug userform's Textboxes, Changing defauld behaviour
    By vin1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-15-2012, 08:38 AM
  3. Userform Textbox Behaviour
    By payney in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2010, 10:06 AM
  4. [SOLVED] Odd Add-in behaviour
    By Pete Church in forum Excel General
    Replies: 0
    Last Post: 03-01-2006, 10:30 AM
  5. Odd Behaviour
    By SteveW in forum Excel General
    Replies: 1
    Last Post: 03-07-2005, 08:54 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