Sheet1.Range("B:B").Insert Dim i, j, k, l As Integer i = 1 k = 0 j = Application.WorksheetFunction.CountA(Sheet1.Range("C:C")) For i = 2 To j l = Sheet1.Cells(i, 3).Interior.ColorIndex If l = 50 Then k = k + 1 End If Sheet1.Cells(i, 2).Value = "a" & k Next