Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts

    font.colorindex (2002)

    Can this be used for font.colorindex? If so, what do i change?

    Sub ColorIndexList()

    ' Begin error trapping.
    On Error GoTo Done

    Range("A1").Select
    ' Put the word Color in active cell.
    ActiveCell.Formula = "Color"
    ' Put the words Color Index Number one cell to right of active cell.
    ActiveCell.Offset(0, 1).Formula = "Color Index Number"

    ' Select one cell down from active cell.
    ActiveCell.Offset(1, 0).Activate

    ' Begin loop from 1 to 56.
    For xColor = 1 To 56

    ' Apply color and pattern properties to active cell.
    With ActiveCell.Interior
    .ColorIndex = xColor
    .Pattern = xlSolid
    .PatternColorIndex = xlAutomatic
    End With

    ' Put color index in cell to right of active cell.
    ActiveCell.Offset(0, 1).Formula = xColor

    ' Select next cell down.
    ActiveCell.Offset(1, 0).Activate

    ' Increment For loop.
    Next xColor

    Done:

    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: font.colorindex (2002)

    Change

    With ActiveCell.Interior
    .ColorIndex = xColor
    .Pattern = xlSolid
    .PatternColorIndex = xlAutomatic
    End With

    to

    ActiveCell.Font.ColorIndex = xColor
    ActiveCell.Value = "Color " & xColor

  3. #3
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: font.colorindex (2002)

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

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