View Single Post
 
Old 04-07-2014, 05:50 AM
pelagic pelagic is offline Mac OS X Office for Mac 2011
Novice
 
Join Date: Apr 2014
Posts: 2
pelagic is on a distinguished road
Default How do I perform simple mathematical calculations on numbers in the text

I have a Word doc which is a stand alone index to be added to an existing project. The index is five pages long and is in two columns with the following format:

effluent treatments 76, 77–78
England, UK 17, 23, 79, 84, 90


At the moment all the numbering is out and I need to subtract 13 from each number.


Am I correct in understanding that you cannot use regular expressions to perform mathematical calculations or is there a simple solution?


I have tried:


Using find and replace with find: ([0-9]{1,2}) replace: ^& (13) to add (13) after all the numbers then selecting all the text and running the ToolsCalculate command. Even if I add spaces either side of each number I keep getting a syntax error? Is it possible to automate this technique using a Macro?


Any suggestions gratefully received!


Thanks
Reply With Quote