You don't need VBA, use the COUNTIF function. This can be used in VBA.