Here's a routine I just wrote for you...
Activate this in the cell to the right of the top cell in your column. It will do as you require - place the color index number opposite each cell in the column to the left - as far down as there is data in the column.
Sub Generate_ColorNumbers()
Application.ScreenUpdating = False
Set_Range
For Each c In Range("color_cells"

ActiveCell.Value = ActiveCell.Offset(0, -1) _
.Interior.ColorIndex
ActiveCell.Offset(1, 0).Activate
Next
Application.ScreenUpdating = True
End Sub
Sub Set_Range()
topcell = ActiveCell.Offset(0, -1).Address
colm = ActiveCell.Offset(0, -1).Column
botmcell = Cells(65536, colm).End(xlUp).Address
rng = topcell & ":" & botmcell
Range(rng).Name = "color_cells"
End Sub
I hope this is what you required. Please advise as to how it fits.
Regards, ...Dale Watson dwatson@bsi.gov.mb.ca