Count cells if less than

Macro Title:
Worksheet Variable:
Worksheet Name:
Range Reference:
range from which you want to count the number of cells that contain a value less than a specific value
Cell Reference of specific value:
enter the value that you want to count for if a cell contains a value less than this
Output Cell:
First Comment:

'
Second Comment:

'
Sub Count_cells_if_less_than()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'apply the formula to count the cells that have a value less than 500
ws.Range("E8") = Application.WorksheetFunction.CountIf(ws.Range("C8:C14"), "<500")

End Sub

Sub Count_cells_if_less_than()
'declare a variable

Dim ws As Worksheet

Set ws = Worksheets("Analysis")
'apply the formula to count the cells that have a value less than 500

ws.Range("E8") = Application.WorksheetFunction.CountIf(ws.Range("C8:C14"), "<500")

End Sub

Sub Count_cells_if_less_than()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'apply the formula to count the cells that have a value less than 500
ws.Range("E8") = Application.WorksheetFunction.CountIf(ws.Range("C8:C14"), "<500")

End Sub