+ Reply to Thread
Results 1 to 18 of 18

Change font color of menu item

  1. #1
    Forum Contributor
    Join Date
    02-14-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2013
    Posts
    339

    Change font color of menu item

    I have a cool right-click menu that's working nicely.

    I would like to color-code the font of various items in the menu, to something other than black.

    I know Excel is ultra-sophisticated.
    Can it do this?

    TIA

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Change font color of menu item

    No I do not think so. (also I do not think this would be good UI design)
    May you not use images?
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  3. #3
    Forum Contributor
    Join Date
    02-14-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2013
    Posts
    339

    Re: Change font color of menu item

    Quote Originally Posted by Izandol View Post
    No I do not think so. (also I do not think this would be good UI design)
    May you not use images?
    Thanks for helping out!
    Well since I'm the only user, I don't think UI design is important in this case.

    I'm surprised and a little disappointed that it can't be done.
    I have a right-click list of around ten macro commands.
    I simply want a few items to stand out, so I can see them quickly.
    I figured that if I could color a few items red, that would do the trick.

  4. #4
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Change font color of menu item

    May you not use images to mark them, or put them first in menu?

  5. #5
    Forum Contributor
    Join Date
    02-14-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2013
    Posts
    339

    Re: Change font color of menu item

    Quote Originally Posted by Izandol View Post
    May you not use images to mark them, or put them first in menu?

    These items are not really the most used and so don't warrant being at the top of the list.
    One macro actually changes a highlighted row to the color 'pink', so I thought if the menu item was pink it would be easy to spot.
    If you could tell me how to get images into the menu list that would be great.

    TIA

  6. #6
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Change font color of menu item

    Commandbarcontrol has Picture property (also Mask if you require masked picture). You may also copy picture from sheet and use PasteFace method.

  7. #7
    Forum Contributor
    Join Date
    02-14-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2013
    Posts
    339

    Re: Change font color of menu item

    Quote Originally Posted by Izandol View Post
    Commandbarcontrol has Picture property (also Mask if you require masked picture). You may also copy picture from sheet and use PasteFace method.
    Thanks Izandol, I will see what I can come up with using your suggestions.

  8. #8
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Change font color of menu item

    Please post again if you have problem. (It is truly 2002 you use?)

  9. #9
    Forum Contributor
    Join Date
    02-14-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2013
    Posts
    339

    Re: Change font color of menu item

    Quote Originally Posted by Izandol View Post
    Please post again if you have problem. (It is truly 2002 you use?)
    OK.
    Yes I am using 2002.
    If software companies relied on users like me to make money they'd all be out of business.

    I found neat VBA code to create a dropdown menu with colors, but unfortunately it's not inside a right-click menu:

    http://www.andypope.info/vba/colourdropdown.htm

    Interestingly, it was created in 2002.

  10. #10
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Change font color of menu item

    You may recreate that with menu using simple block pictures.

  11. #11
    Forum Contributor
    Join Date
    02-14-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2013
    Posts
    339

    Re: Change font color of menu item

    Quote Originally Posted by Izandol View Post
    You may recreate that with menu using simple block pictures.
    If you can give me some hints on how to do this it would be great.

    Here is the code that sets up my right-click menu:

    Sub RightClick()
    Dim vArr As Variant, i As Integer
    Dim oMenu As CommandBar, oltem As CommandBarControl
    Set oMenu = CommandBars.Add("", msoBarPopup, , True)
    vArr = Array("DateEnd", "DateIn", "Black", "Pink", "Copy", "Cut", "Paste", "Del", "InsRow", "DelRow", "CutPaste2014", "Save", "MinWin")
    For i = 0 To UBound(vArr)
    Set oItem = oMenu.Controls.Add
    oItem.Caption = vArr(i)
    oItem.OnAction = vArr(i)
    Next i
    oMenu.ShowPopup
    End Sub

  12. #12
    Forum Contributor
    Join Date
    02-14-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2013
    Posts
    339

    Re: Change font color of menu item

    OK, so I now know hundreds of .FaceID's.
    I have also seen many custom Excel menus in VBA code.
    But the code is quite different from mine (above).

    Any tips how I can simply add a .FaceID to one of my menu items?
    They are all primed and ready for faces.

  13. #13
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Change font color of menu item

    Please Login or Register  to view this content.
    for example.

  14. #14
    Forum Contributor
    Join Date
    02-14-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2013
    Posts
    339

    Re: Change font color of menu item

    Quote Originally Posted by Izandol View Post
    Please Login or Register  to view this content.
    for example.

    OK cool!
    I added the code here:


    vArr = Array("DateEnd", "DateIn", "Black", "Pink", "Copy", "Cut", "Paste", "Del", "InsRow", "DelRow", "CutPaste2014", "Save", "MinWin")
    For i = 0 To UBound(vArr)
    Set oItem = oMenu.Controls.Add
    oItem.Caption = vArr(i)
    oItem.OnAction = vArr(i)
    oItem.FaceID = 23 < --------------------
    Next i
    oMenu.ShowPopup
    End Sub

    But now all of the menu entries have the icon!
    How can I tell the code to show the icon next to the third menu item only?

  15. #15
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Change font color of menu item

    Please Login or Register  to view this content.

  16. #16
    Forum Contributor
    Join Date
    02-14-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2013
    Posts
    339

    Re: Change font color of menu item

    Quote Originally Posted by Izandol View Post
    Please Login or Register  to view this content.

    Thank you very much Izandol!
    This worked out very nicely.
    I appreciate your kind support.

  17. #17
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Change font color of menu item

    You are welcome.

    You may also use array of FaceId matching the caption array if you wish more than one item with picture.

  18. #18
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Change font color of menu item

    @ ChrisXcel,

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

    Regards
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

+ 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: 2
    Last Post: 02-04-2013, 02:00 PM
  2. Change font color based on font color of another cell
    By Ibyers in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2012, 09:36 AM
  3. change font color and font style in shape
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-05-2011, 10:05 AM
  4. Change font if item above is not hidden
    By Elaine in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-16-2005, 12:06 PM

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