Hello, I want to calculate the sum of the number of cells after there is the value in the cell ("F3")... Exemple if you find the value in ("A80")
Cells are counted from A80 to me A99
smiller and which is squale to CELLE F3
Cells are counted from A80 to me A99
smiller and which is squale to CELLE F3
VBA Code:
Sub Count_cells_if()
Dim ws As Worksheet
Set ws = Worksheets("sh1")
ws.Range("a100") = Application.WorksheetFunction.CountIf(ws.Range("a1:a99"), "<=" & ws.Range("f3"))
ws.Range("b100") = Application.WorksheetFunction.CountIf(ws.Range("b1:b99"), "<=" & ws.Range("f3"))
ws.Range("c100") = Application.WorksheetFunction.CountIf(ws.Range("c1:c99"), "<=" & ws.Range("f3"))
ws.Range("d100") = Application.WorksheetFunction.CountIf(ws.Range("d1:d99"), "<=" & ws.Range("f3"))
End Sub