Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-08-2017, 03:34 PM
macropod's Avatar
macropod macropod is offline Autocorrect numbers followed by any string to have non-breaking space Windows 7 64bit Autocorrect numbers followed by any string to have non-breaking space Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could use a fairly simple Find/Replace macro assigned to a keyboard shortcut. For example:


Code:
Sub Demo()
Application.ScreenUpdating = False
With Selection.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "([0-9]) "
    .Replacement.Text = "\1^s"
    .Forward = True
    .Wrap = wdFindStop
    .Format = False
    .MatchWildcards = True
    .Execute Replace:=wdReplaceAll
  End With
End With
Application.ScreenUpdating = True
End Sub
Simply select the range to process - if you don't select anything, everything from the insertion point to the end of the document will be processed.

Making an autocorrect option for this would probably cause more problems than it's worth - even you most likely don't want a non-breaking space to replace the ordinary space after every number or even most numbers in a given document.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Autocorrect numbers followed by C to °C? seanspotatobusiness Word 8 07-09-2019 02:16 PM
Autocorrect numbers followed by any string to have non-breaking space autocorrect double space to single space frankjake Word 8 09-21-2018 05:44 PM
Autocorrect numbers followed by any string to have non-breaking space Non-breaking space and similar characters gpr Word 2 07-10-2015 06:44 AM
Autocorrect numbers followed by any string to have non-breaking space macro to find a character and insert space so autocorrect will expand redzan Word VBA 3 05-22-2014 04:22 PM
How to extract only numbers from a STRING? Learner7 Excel 3 07-02-2013 06:25 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:41 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft