+ Reply to Thread
Results 1 to 25 of 25

Make a box appear / disappear depending on drop down form selection

  1. #1
    Registered User
    Join Date
    01-29-2013
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    27

    Make a box appear / disappear depending on drop down form selection

    Hi,

    Can any help!

    Basically i have a drop down box, cover promotion, change of hours, salary increase, act up allowance and etc on

    i want a box to appear if i chose promotion or change of hours only then if i dont, it will disappear, how can i do that?

    Thanks appreciated

    Kind regards

    Excelyee

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Make a box appear / disappear depending on drop down form selection

    Try setting the 'visible' property of the object ... 'True' makes it visible and 'False' hides it.

  3. #3
    Registered User
    Join Date
    01-29-2013
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Make a box appear / disappear depending on drop down form selection

    Thanks, sorry where is the visible property?

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Make a box appear / disappear depending on drop down form selection

    You set the property in your code as in:
    Please Login or Register  to view this content.
    If you could post a copy of your file with a detailed explanation of what you would like to do, it would be easier to help.

  5. #5
    Registered User
    Join Date
    01-29-2013
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Make a box appear / disappear depending on drop down form selection

    Here a copy of my spreadsheet, what i would like to do is

    If i select promotion, then roll 52 to 54 will appear and roll 49 to 51 will be disappear
    If i select Acting up allowance, then only roll 50 will appear and the roll 49, 51-54 will disappear

    is this possble?testing file xls.xls

    Many thanks

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Make a box appear / disappear depending on drop down form selection

    What do you mean by
    roll 52 to 54
    What is a roll?

  7. #7
    Registered User
    Join Date
    01-29-2013
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Make a box appear / disappear depending on drop down form selection

    Sorry my error I meant row

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Make a box appear / disappear depending on drop down form selection

    Hi excelyee. I assumed that by "roll" you meant "row". Place the following code into the worksheet module for the sheet 'Personnel Change' (not into a regular module).

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    01-29-2013
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Make a box appear / disappear depending on drop down form selection

    thank you so much, this is working perfectly!

    appreciated your help :-)

  10. #10
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Make a box appear / disappear depending on drop down form selection

    My pleasure.

  11. #11
    Registered User
    Join Date
    01-29-2013
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Make a box appear / disappear depending on drop down form selection

    Hi ya,

    If i protected the worksheet, the macro is no longer working, can you help?

    Thanks

    kind regards

    Sandy

  12. #12
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Make a box appear / disappear depending on drop down form selection

    If the sheet is protected, the macro must first unprotect it, perform its task and then protect it again. Use the following code:
    Please Login or Register  to view this content.
    If you used a password to protect the sheet, then change the two new lines at the beginning and end of the macro to:
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    01-29-2013
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Make a box appear / disappear depending on drop down form selection

    Thank you for your help

  14. #14
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Make a box appear / disappear depending on drop down form selection

    My pleasure.

  15. #15
    Registered User
    Join Date
    01-29-2013
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Make a box appear / disappear depending on drop down form selection

    Quote Originally Posted by Mumps1 View Post
    My pleasure.
    Hi, sorry to be a pain, wander if u could help, is there a code I could use for example if they reply to no then macro tell them to move to the right questions or columns

  16. #16
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Make a box appear / disappear depending on drop down form selection

    What do you mean by
    if they reply to no then macro tell them to move to the right questions or columns
    Please be more specific with exactly what you would like to do step by step.

  17. #17
    Registered User
    Join Date
    01-29-2013
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Make a box appear / disappear depending on drop down form selection

    Quote Originally Posted by Mumps1 View Post
    What do you mean by Please be more specific with exactly what you would like to do step by step.
    What I wanted to do is from the spreadsheet I have shown you last time, this time I want to use macro to tell me if I picked (for example promotion) from a drop down list then a message appear to tell me to complete (e.g. Column f) or direct me straight to that column? Is this possible?

    Thank you

  18. #18
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Make a box appear / disappear depending on drop down form selection

    At the moment, the macro hides/unhides certain rows if you choose "Promotion" or "Acting Up Allowance". Unfortunately, we can't have the macro do something else if "Promotion" is chosen because that would confuse Excel. It wouldn't know what to do because you are asking it to do two different things. As well, you have many merged cells in your sheet and merged cells most often also cause problems for Excel. Would it not be just as easy to simply click in the column you want and enter your data? Is there a reason why you want a macro to do this?

  19. #19
    Registered User
    Join Date
    01-29-2013
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Make a box appear / disappear depending on drop down form selection

    Quote Originally Posted by Mumps1 View Post
    At the moment, the macro hides/unhides certain rows if you choose "Promotion" or "Acting Up Allowance". Unfortunately, we can't have the macro do something else if "Promotion" is chosen because that would confuse Excel. It wouldn't know what to do because you are asking it to do two different things. As well, you have many merged cells in your sheet and merged cells most often also cause problems for Excel. Would it not be just as easy to simply click in the column you want and enter your data? Is there a reason why you want a macro to do this?
    the reason why I like to do this is because I can ensure they complete all the required column.

  20. #20
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Make a box appear / disappear depending on drop down form selection

    Do you mean that you want to make sure that the pink cells are completed every time the reason for a change is selected in cell C17?

  21. #21
    Registered User
    Join Date
    01-29-2013
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Make a box appear / disappear depending on drop down form selection

    [QUOTE=excelyee;3130065]Hi, sorry to be a pain, wander if u could help, is there a code I could use for example if they reply to no then macro tell them to move to the right questions or columns[/QUO

    Thanks for the advise, I have another questions, when I use the name manager in excel, if I use name like TS1 it will not let me as its conflict with excel built in name, is there anany way I can override this? Thank you so much

  22. #22
    Registered User
    Join Date
    01-29-2013
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Make a box appear / disappear depending on drop down form selection

    Quote Originally Posted by Mumps1 View Post
    Do you mean that you want to make sure that the pink cells are completed every time the reason for a change is selected in cell C17?
    Thanks for the advise, I have another questions, when I use the name manager in excel, if I use name like TS1 it will not let me as its conflict with excel built in name, is there anany way I can override this? Thank you so much

  23. #23
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Make a box appear / disappear depending on drop down form selection

    Maybe you could try a different name.

  24. #24
    Registered User
    Join Date
    01-29-2013
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Make a box appear / disappear depending on drop down form selection

    Quote Originally Posted by Mumps1 View Post
    Maybe you could try a different name.
    I need to use the same name? Is this possible thx

  25. #25
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Make a box appear / disappear depending on drop down form selection

    To be honest with you, I'm not really sure.

+ 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