+ Reply to Thread
Results 1 to 7 of 7

Mimic Font Color Picker - Apply Active(?) Color

  1. #1
    Forum Contributor delaing's Avatar
    Join Date
    07-16-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    192

    Mimic Font Color Picker - Apply Active(?) Color

    I'll spare you the reason for why I'm trying to replicate part of the functionality of the built-in FontColorPicker (RibbonX customization).

    Is there some system or environment property I can use in VBA to change the font color (cell contents) to the "active" font color?
    If I've already used the FontColorPicker to apply say Red to cell contents, does Excel remember that color selection in a system property that I can make use of?

    Looking to do the same for CellFillColorPicker.

    Let me know if I'm not being clear enough with my request.

    Thanks in advance,
    Delain

    cross-posted: http://www.eileenslounge.com/viewtopic.php?f=27&t=28225
    I say this optimistically . . . One day I'll understand it.
    But today is not that day!

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,158

    Re: Mimic Font Color Picker - Apply Active(?) Color

    This will not get the value, but it will apply the colors to the currently selected cells. So your code will have to Select the desired cells.

    Please Login or Register  to view this content.
    Ref: https://social.msdn.microsoft.com/Fo...forum=exceldev
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor delaing's Avatar
    Join Date
    07-16-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    192

    Re: Mimic Font Color Picker - Apply Active(?) Color

    Thanks for the suggestion. I already have the idMSO syntax for the "pickers" to use in my RibbonX setup (i.e. CellFillColorPicker, FontColorPicker).
    Problem is, when adding the pickers into a RibbonX they seem to lose the built-in functionality of being able to click on their associated "face" button and have it apply, whichever color is currently showing on the face as the active color, to the selected cell contents.

    So, I was going to rework my RibbonX to have a Splitbutton with a Button to perform the apply-active-color as the face of the Splitbutton. And then have a child menu, below the Splitbutton, with the colorpicker Gallery included there. Make sense?

    To do that, I need to know where Excel stores the active color (most-recently selected via a picker) so that I can access that system variable.

    Thank you,
    Delain

  4. #4
    Forum Contributor delaing's Avatar
    Join Date
    07-16-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    192

    Re: Mimic Font Color Picker - Apply Active(?) Color

    I am working on how to implement this.

    Thank you,
    Delain

  5. #5
    Forum Contributor delaing's Avatar
    Join Date
    07-16-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    192

    Re: Mimic Font Color Picker - Apply Active(?) Color

    Okay, appears I jumped the Submit button too quickly before fully evaluating 6StringJazzer's input here.
    Apologies for this and already applying salve to my back for the 39+1 lashes I've subjected myself to, on my own.

    This indeed does the trick.
    For others who may need this:
    Please Login or Register  to view this content.
    Thank you,
    Delain

  6. #6
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Mimic Font Color Picker - Apply Active(?) Color

    I used a "blank" cell to get the values. It is not fool-proof but should work most of the time. Of course this does edit the file so the user would be prompted to save even if they made no changes.

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor delaing's Avatar
    Join Date
    07-16-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    192

    Re: Mimic Font Color Picker - Apply Active(?) Color

    Kenneth,

    Thank you for your work.
    I'm not following this all the way.

    Correct me on this:
    Your procedure is "getting" the font color and the cell interior color from a cell that is empty, outside of the used area, after applying the active colors to that empty cell, correct? Then returning those values to the fc and ic variables?

    How do you see me using this based on the description of the problem? (I'm not a VBA expert, by any strectch, so I'm sure I'm missing your intention.)
    How would I use the fc and ic variables?

    Thanks in advance,
    Delain

+ 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. Apply Color to chart based on Data source text color
    By ajm1991 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-07-2016, 08:41 PM
  2. Font color in Active X combo box
    By superchew in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-29-2015, 03:25 AM
  3. Macro to add data labels and color font white in Active Tab for all charts?
    By Dude to Excel Dude in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-12-2014, 01:54 PM
  4. Click an active cell to change filled and font color
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-14-2013, 11:03 PM
  5. Replies: 2
    Last Post: 02-04-2013, 02:00 PM
  6. 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
  7. Changing font color of active cell
    By ridesisapis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2009, 08:10 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