+ Reply to Thread
Results 1 to 7 of 7

Programming Dropdown Box to allow certain selections to change fonts

  1. #1
    Registered User
    Join Date
    01-05-2012
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    5

    Programming Dropdown Box to allow certain selections to change fonts

    Hi Guys,

    I am hoping that this can be done.

    I have a bunch of word dropdown boxes and I need to change the color of certain words based on what the user has selected. For instance if the user chooses the word "vacant" then highlight the selected word red. I also need it to work so that if any other words are selected the word is kept in black.

    Hope someone can help.

    Regards,
    Mykie

    This is what I have attempted:

    Please Login or Register  to view this content.
    Last edited by Cutter; 08-01-2012 at 08:06 AM. Reason: Added code tags

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Programming Dropdown Box to allow certain selections to change fonts

    Hi Mykie,

    Your macro works fine, so I don't see what the issue is.

    PS: When posting code, please use the code tags.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Registered User
    Join Date
    01-05-2012
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Programming Dropdown Box to allow certain selections to change fonts

    Thanks for the reply.

    yes, the macro seems to work fine however when I protect the document and select "vacant" from the list whether I remain in the field or exit it the word remains black. I ensure that macro works on exit however it doesnt seem to operate as I wanted it too?

    cheers,
    Mykie

  4. #4
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Programming Dropdown Box to allow certain selections to change fonts

    As it's an 'On Exit' macro, you must exit the formfield (eg by pressing the Tab key) to trigger it.

  5. #5
    Registered User
    Join Date
    01-05-2012
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Programming Dropdown Box to allow certain selections to change fonts

    Quote Originally Posted by macropod View Post
    As it's an 'On Exit' macro, you must exit the formfield (eg by pressing the Tab key) to trigger it.
    Hey Macro,

    cheers for the response again.

    I understand what you are saying but I kept getting a "Run-Time Error 4605: This Command Is Not Available" When You Use PageSetup Property" message which was causing me grief. I ended up just closing the document and reopening it which seem to have it working again. Not sure what the issue was but I got it working now.



    Cheers,
    Mykie

  6. #6
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Programming Dropdown Box to allow certain selections to change fonts

    Hi Mykie,

    I don't understand why you'd get such an error - there's no page setup code involved.

  7. #7
    Registered User
    Join Date
    01-05-2012
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Programming Dropdown Box to allow certain selections to change fonts

    Hi Macro,

    I can't elaborate any further, sorry.

    I am not sure why the error occured but it seems to have gone away now with a new reopened document.

    Regards,
    Mykie

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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