can someone tech how to make a codes that counts cell with green background and has a value of 0?
here's my code
Public Sub FormattingCells()
Dim lastRow As Long, i As Long
Dim total As Integer
lastRow = 5
For i = 2 To lastRow
Range("B6:B6").Value = 0 + Val(Cells(i, 2).Interior.ColorIndex = 4 And Cells(i, 2).Value < 1)
Next
Range("B6").Value = total
End Sub