+ Reply to Thread
Results 1 to 10 of 10

Display colors next to list of hex color codes

Hybrid View

  1. #1
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,446

    Re: Display colors next to list of hex color codes

    Here is an update to the previously attached file :

    
    Sub colors56()
    '57 colors, 0 to 56
    
    Dim i As Long
    Dim str0 As String, str As String
    Cells(1, 7) = "Interior"
    Cells(1, 8) = "Font"
    Cells(1, 9) = "HTML"
    Cells(1, 10) = "RED"
    Cells(1, 11) = "GREEN"
    Cells(1, 12) = "BLUE"
    Cells(1, 13) = "COLOR"
    
    
    For i = 0 To 56
        Cells(i + 2, 7).Interior.ColorIndex = i
        Cells(i + 2, 8).Font.ColorIndex = i
        Cells(i + 2, 8).Value = "[Color " & i & "]"
        str0 = Right("000000" & Hex(Cells(i + 2, 7).Interior.Color), 6)
        'Excel shows nibbles in reverse order so make it as RGB
       str = Right(str0, 2) & Mid(str0, 3, 2) & Left(str0, 2)
        'generating 2 columns in the HTML table
       Cells(i + 2, 9) = "#" & str
        Cells(i + 2, 10).Formula = "=Hex2dec(""" & Right(str0, 2) & """)"
        Cells(i + 2, 11).Formula = "=Hex2dec(""" & Mid(str0, 3, 2) & """)"
        Cells(i + 2, 12).Formula = "=Hex2dec(""" & Left(str0, 2) & """)"
        Cells(i + 2, 13) = "[Color " & i & "]"
    Next i
    End Sub
    Attached Files Attached Files

+ 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. assign colors to graphs using color codes in a table
    By flummel in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-13-2016, 09:49 AM
  2. Replies: 7
    Last Post: 08-22-2015, 03:51 PM
  3. Replies: 1
    Last Post: 08-22-2015, 12:36 PM
  4. [SOLVED] I need to change the codes and let it reverses the colors back.
    By akinkaraman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-23-2015, 02:39 PM
  5. Filter Zip Codes from a list codes
    By jaugent27 in forum Excel General
    Replies: 3
    Last Post: 06-11-2013, 02:01 PM
  6. Replies: 1
    Last Post: 11-19-2012, 12:04 PM
  7. ComboBox with a list of Metal Colors which changes price when colors are selected.
    By 1976dan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-25-2012, 04:48 AM

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