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
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
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
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.
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
Commandbarcontrol has Picture property (also Mask if you require masked picture). You may also copy picture from sheet and use PasteFace method.
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.
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
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.![]()
for example.![]()
Please Login or Register to view this content.
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?
![]()
Please Login or Register to view this content.
You are welcome.
You may also use array of FaceId matching the caption array if you wish more than one item with picture.
@ 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] .
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks