Bluepoint Design

Practical Cost-Effective Solutions
Macro Express Sample Macro: Occurrences

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

Page last updated: 06/24/2009

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