Bluepoint Design

Practical cost effective solutions   
Macro Express Sample Macro: Occurrences

Home
Up
Multiple Choice Trick
Multiple Multiple Choice
Occurrences
Repeat Validation
GoTo
First file
Fax PDF Breakup
Day of Year
Multiple Attachments
Multiple eMail Addresses
Text Padding
Building TSV Files

Page last updated: 02/05/2008

Often I need to count the number of occurrences of something. In the past I would replace instances in a repeat but I recently though of a more elegant way.

Simply count the number of characters in the body of text, replace all occurrences of the desired character or string with nothing, and count again. The difference divided by the number of characters in the replacement text is the number of occurrences!

occurrences.mex
Macro Text
 
Practical cost effective solutions