Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-27-2022, 06:47 AM
Chris.Bowman Chris.Bowman is offline Word macro - Super/sub-script and 2 spaces to 1 space Windows 11 Word macro - Super/sub-script and 2 spaces to 1 space Office 2016
Novice
Word macro - Super/sub-script and 2 spaces to 1 space
 
Join Date: Oct 2022
Posts: 1
Chris.Bowman is on a distinguished road
Default Word macro - Super/sub-script and 2 spaces to 1 space

I'm trying to write a macro in Word that will make 2 spaces into 1 space after a punctuation and formatting section, like this, where the 23-29 will superscripted and be links to references at the end of the document.



dultricies.23-29 Purus

I would like the macro to identify the two spaces after the superscript and make it 1 space.

Thanks,

Chris

I tried creating the macro to identify 2 spaces and make it 1 space - that worked. But when I tried to create a macro using wildcard characters or special formatting (superscript), I expected Word to locate the instance and make it one space, but it did not.
Reply With Quote
  #2  
Old 10-27-2022, 02:26 PM
Guessed's Avatar
Guessed Guessed is offline Word macro - Super/sub-script and 2 spaces to 1 space Windows 10 Word macro - Super/sub-script and 2 spaces to 1 space Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,184
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Are there other instances of double spaces in the document that you want to stay with double spaces?

Show us the macro you created and attach a sample document that shows instances of what needs to be found (and not found)
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 10-27-2022, 02:33 PM
macropod's Avatar
macropod macropod is offline Word macro - Super/sub-script and 2 spaces to 1 space Windows 10 Word macro - Super/sub-script and 2 spaces to 1 space Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,513
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

Cross-posted (and answered before posting here) at: vba - 2 spaces to 1 space after punctuation and super/subscript - Stack Overflow
For cross-posting etiquette, please read: Excelguru Help Site - A message to forum cross posters
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to highlight only start of line, not past tab spaces (Word 97) Genericname1111 Word VBA 1 01-22-2020 11:25 AM
Word macro - Super/sub-script and 2 spaces to 1 space Spaces not appearing unless I type another word after the space seanspotatobusiness Word 4 06-27-2018 04:35 PM
Word macro - Super/sub-script and 2 spaces to 1 space Replace Two Spaces with One Space doctorduncan Word 2 06-08-2018 04:44 PM
Word macro - Super/sub-script and 2 spaces to 1 space Creating a "super macro" with all kind of functions Xanthopteryx PowerPoint 1 06-16-2016 01:38 AM
Word macro - Super/sub-script and 2 spaces to 1 space replace data from variable with "sub and super script" from excel to word by vba krishnaoptif Word VBA 9 06-22-2012 05:08 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:54 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