Yeah, like this:<br>
<br>
The following line:<br>
<br>
Colour = Worksheets("Sheet1"

.Cells(Counter, 1).Interior.ColorIndex <br>
<br>
contains a reference to Excel's Worksheets.Cells property. The .Cells property has two arguments - row number, column number. In the example I already gave you, row number was determined by the variable Counter, which altered through the range 1 to 10 as the For ... Next loop ran. Column number, however, was static (1).<br>
<br>
The following example shows how, by putting in another For...Next loop to increment a variable called ColumnCounter, you can make Excel loop through columns as required.<br>
<br>
Set up a new worksheet, colour the cells in Col A as before, then do the same in Col B. Then run this macro.<br>
<br>
Sub CountColours()<br>
'<br>
' CountColours Macro<br>
' Macro written 21/02/2000 by PJJ<br>
'<br>
' Keyboard Shortcut: Ctrl+l<br>
'<br>
Dim RedCells, GreenCells, BlueCells, YellowCells As Variant<br>
Dim Colour As Variant<br>
Dim CellCounter, ColumnCounter As Integer<br>
<br>
For ColumnCounter = 1 To 2<br>
For CellCounter = 1 To 10<br>
Colour = Worksheets("Sheet1"

.Cells(CellCounter, ColumnCounter).Interior.ColorIndex<br>
Select Case Colour<br>
Case 3<br>
RedCells = RedCells + 1<br>
Case 4<br>
GreenCells = GreenCells + 1<br>
Case 5<br>
BlueCells = BlueCells + 1<br>
Case 6<br>
YellowCells = YellowCells + 1<br>
End Select<br>
Next<br>
Next<br>
<br>
Worksheets("Sheet1"

.Range("C1"

.Value = RedCells<br>
Worksheets("Sheet1"

.Range("C2"

.Value = GreenCells<br>
Worksheets("Sheet1"

.Range("C3"

.Value = BlueCells<br>
Worksheets("Sheet1"

.Range("C4"

.Value = YellowCells<br>
<br>
<br>
End Sub<br>
<br>