+ Reply to Thread
Results 1 to 7 of 7

Mimic Font Color Picker - Apply Active(?) Color

Hybrid View

  1. #1
    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:
    Sub FontColorPicker_mimic(control As IRibbonControl)
    
        With ActiveCell
            Application.CommandBars.ExecuteMso "FontColorPicker"
        End With
        
    End Sub
    Thank you,
    Delain
    I say this optimistically . . . One day I'll understand it.
    But today is not that day!

  2. #2
    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.

    Sub Test_getColors()
      Dim fc As Double, ic As Double
      getColors fc, ic
      Debug.Print fc, ic
    End Sub
    
    Sub getColors(ByRef FontColorPicker As Double, ByRef _
      CellFillColorPicker As Double, Optional ac As Range)
      Dim r As Range
      If ac Is Nothing Then Set ac = ActiveCell
      Set r = ActiveSheet.UsedRange
      Set r = Cells(r.Rows.Count + 1, "A")
      r.Select
      Application.CommandBars.ExecuteMso "FontColorPicker"
      FontColorPicker = r.Font.Color
      r.Clear
      Application.CommandBars.ExecuteMso "CellFillColorPicker"
      CellFillColorPicker = r.Interior.Color
      r.Clear
      ac.Select
    End Sub

+ 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