+ Reply to Thread
Results 1 to 2 of 2

Macro to Create Specific color palette boxes for Quick Access Toolbar

Hybrid View

  1. #1
    Registered User
    Join Date
    02-12-2012
    Location
    White Mountains, NH
    MS-Off Ver
    Excel 2007
    Posts
    65

    Macro to Create Specific color palette boxes for Quick Access Toolbar

    Hi,
    I'm seeking assistance in creating a macro that provides specific color palette selection boxes on my QAT for color-filling cells.
    My five colors are: (from the excel color palette)
    Gold: Color 45
    Rose: Color 38
    Blue: Color 37
    Green: Color 43
    Yellow: Color 6

    Thanks,
    Chubs

  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,005

    Re: Macro to Create Specific color palette boxes for Quick Access Toolbar

    You will need a different macro for each color.

    To use color index for gold, create a sub like this in a generic module (like Module1) then create buttons in your QAT that are associated with the macros. Unfortunately, since 2007 the images used for the QAT buttons themselves cannot be customized.
    Public Sub FillGold()
       Selection.Interior.ColorIndex = 45
    End Sub

    Your numbers are color index numbers and can be customized so they may not be the same on different versions of Excel and different machines. It is more portable to use RGB numbers. To use the RGB numbers:
    Public.Sub FillGold()
       Selection.Interior.Color = RGB(255, 153, 0)
    End Sub
    You will have to derive the RGB numbers for each color if you want to do this. I wrote some code that creates samples of each color in the palette:
    Private Sub test()
    
       Dim i As Long
       For i = 1 To 256
       Cells(i, "A").Interior.ColorIndex = i
       Next i
    
    End Sub
    Then you can open the Fill Color dialog, in Custom, to see the RGB numbers.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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: 1
    Last Post: 08-21-2017, 03:36 PM
  2. Adding buttons in quick access toolbar via macro
    By Crispy85 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-01-2017, 10:06 AM
  3. Replies: 0
    Last Post: 01-26-2015, 07:56 PM
  4. [SOLVED] Modify Excel 2010 Quick Access Toolbar Macro Icon using VBA
    By unhappyCamper in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-12-2014, 11:46 AM
  5. How to change help text associated with a macro button on Quick Access Toolbar?
    By XmisterIS in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-25-2014, 06:49 AM
  6. How to create custom icons for Quick Access Toolbar?
    By ReplicaR in forum Excel General
    Replies: 2
    Last Post: 12-11-2012, 04:12 PM
  7. Replies: 0
    Last Post: 08-02-2010, 06:18 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