For each loop Cells

Selection cells
Sub ForEach()
Dim rng As Range
Set rng = Selection
A = 1
Selection.Interior.ColorIndex = 0
For Each c In rng
c.Select
Selection.Value = A
A = A + 1
Selection.Interior.ColorIndex = A
Next
End Sub