Count cells if ends with

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

'
Second Comment:

'
Sub Count_cells_if_ends_with_a_specific_value()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'count the number of cells in range (B8:B14) that end with "es"
ws.Range("E8") = Application.WorksheetFunction.CountIf(ws.Range("B8:B14"), "*es")

End Sub

Sub Count_cells_if_ends_with_a_specific_value()
'declare a variable

Dim ws As Worksheet

Set ws = Worksheets("Analysis")
'count the number of cells in range (B8:B14) that end with "es"

ws.Range("E8") = Application.WorksheetFunction.CountIf(ws.Range("B8:B14"), "*es")

End Sub

Sub Count_cells_if_ends_with_a_specific_value()
'declare a variable
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'count the number of cells in range (B8:B14) that end with "es"
ws.Range("E8") = Application.WorksheetFunction.CountIf(ws.Range("B8:B14"), "*es")

End Sub