Programmer_n
04-21-2016, 04:00 AM
I am working on a macro to identify numbers and highlight in my document.
Using .Text = "[0-9]{1,}" to find the numbers and oRng.HighlightColorIndex = wdRed to highlight the numbers i am able to highlight the numbers.
Now, my case is to search and highlight the units when there are units like
3 m/s
45.13 kWh
45 m3
So, the search would be a mixture of decimal,small letters, upper case, superscript and a space between number and unit. I want to write a
.Text to accommodate this features. Is it possible to accommodate such a deep query within .Text? If yes, Please help.
Using .Text = "[0-9]{1,}" to find the numbers and oRng.HighlightColorIndex = wdRed to highlight the numbers i am able to highlight the numbers.
Now, my case is to search and highlight the units when there are units like
3 m/s
45.13 kWh
45 m3
So, the search would be a mixture of decimal,small letters, upper case, superscript and a space between number and unit. I want to write a
.Text to accommodate this features. Is it possible to accommodate such a deep query within .Text? If yes, Please help.