Help with macaro for non breaking space

B

B

I have a document which has data like 5 hours, 4 months,
4.5 mg etc., kind of data. I would like to create a macro
where one clicks the button and it puts non breaking space
between digit and the unit. Any help!!

Thanks
B
 
J

Jay Freedman

Hi, B,

You can do this without a macro, or you can record a macro for the
convenience of being able to repeat it easily.

The idea is to do a wildcard Replace as discussed at
http://word.mvps.org/FAQs/General/UsingWildcards.htm. For the job at hand,
click the More button and check the Use Wildcards box. Then fill the Find
What box with

([0-9]) ([a-zA-Z])

[with a regular space between the first right parenthesis and the second
left parenthesis]. Fill the Replace With box with

\1 \2

[with a nonbreaking space -- entered by pressing Ctrl+Shift+spacebar --
between the 1 and the following backslash]. Click the Replace All button.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top