Results 1 to 11 of 11

Thread: [RESOLVED] EXCEL: ? Range of Cell Fill Colors

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    Resolved [RESOLVED] EXCEL: ? Range of Cell Fill Colors

    Esteemed Forum Participants and Lurkers:
    ===============================
    Excel 2003 VBA

    As near as I can tell, the range of Fill Colors for Cells is from 0 to 56, and -4142. Is this all I get? No custom color fill?

    By the way, here is a macro to build a map of Color Index values in Column A, and Column B filled with that color. Run it on a blank sheet:
    Code:
    Option Explicit
    'Display your COLOR PALLETTE
    Sub Macro1()
    Dim i As Integer
    Dim jRow As Integer
    
    'Start at the first row
    jRow = 1
    
    'This is a funny Color Index, but it works!
    i = -4142
    'Load the funny color
    Cells(jRow, "A").Value = i
    Cells(jRow, "B").Interior.ColorIndex = i
    
    'Walk down the sheet putting the index in A and coloring B
    For i = 0 To 57
        jRow = jRow + 1
        On Error GoTo ERROR_COLOR_INDEX
            Cells(jRow, "A").Value = i
            Cells(jRow, "B").Interior.ColorIndex = i
        On Error GoTo 0
    Next i
    Exit Sub
    '
    ERROR_COLOR_INDEX:
        Cells(jRow, "A").Value = i
        Cells(jRow, "B").Value = "END"
        End
        
    End Sub
    Last edited by Webtest; Feb 23rd, 2006 at 08:15 AM.
    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width