Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-09-2025, 11:44 PM
WJSwanepoel WJSwanepoel is offline Picking up trailing space before quotation mark Windows 10 Picking up trailing space before quotation mark Office 2021
Advanced Beginner
Picking up trailing space before quotation mark
 
Join Date: Dec 2019
Location: Krugersdorp, South Africa
Posts: 82
WJSwanepoel is on a distinguished road
Question Picking up trailing space before quotation mark

I have document where the closing quotation mark is preceded by a space. I need to remove that space. However I cannot search for a space followed by the quotation mark and do a global replace, because the opening quotation mark is always preceded by a space.



How can I do the correction using wildcard search and replace?

The document contains too many of these to make manual replacements feasible.

Example:
This is simply a "political agenda ".
Must become:
This is simply a "political agenda".

I also need to mention that the "closing" quotation mark is actually an "opening" quotation mark i.e. a ^0147 rather than a ^0148.
This is simply a ^0147political agenda ^0147.
Must become:
This is simply a ^0147political agenda^0148.

Last edited by WJSwanepoel; 02-10-2025 at 12:05 AM. Reason: To give more clarity
Reply With Quote
  #2  
Old 02-10-2025, 04:08 AM
macropod's Avatar
macropod macropod is offline Picking up trailing space before quotation mark Windows 10 Picking up trailing space before quotation mark Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,465
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

Quite simple. Use an ordinary Find/Replace for:
Find = ^32".
Replace = ".
then
Find = "
Replace = "
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 02-10-2025, 04:30 AM
WJSwanepoel WJSwanepoel is offline Picking up trailing space before quotation mark Windows 10 Picking up trailing space before quotation mark Office 2021
Advanced Beginner
Picking up trailing space before quotation mark
 
Join Date: Dec 2019
Location: Krugersdorp, South Africa
Posts: 82
WJSwanepoel is on a distinguished road
Default Does not work

This does not work for me. The closing quote is not always followed by a full stop. It can be almost anything a space, a comma, a colon, a Questions mark etc.

Last edited by WJSwanepoel; 02-10-2025 at 04:31 AM. Reason: Typing erros
Reply With Quote
  #4  
Old 02-10-2025, 04:41 AM
macropod's Avatar
macropod macropod is offline Picking up trailing space before quotation mark Windows 10 Picking up trailing space before quotation mark Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,465
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

It shouldn't matter that there's a trailing space after the closing quote. If you want to deal with other punctuation characters, you could use a wildcard Find/Replace where:
Find = [ ^s]"([.,;:\?\!])
Replace = "\1
then:
Find = "
Replace = "
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 02-10-2025, 06:14 AM
WJSwanepoel WJSwanepoel is offline Picking up trailing space before quotation mark Windows 10 Picking up trailing space before quotation mark Office 2021
Advanced Beginner
Picking up trailing space before quotation mark
 
Join Date: Dec 2019
Location: Krugersdorp, South Africa
Posts: 82
WJSwanepoel is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
It shouldn't matter that there's a trailing space after the closing quote. If you want to deal with other punctuation characters, you could use a wildcard Find/Replace where:
Find = [ ^s]"([.,;:\?\!])
Replace = "\1
then:
Find = "
Replace = "
This finds nothing, see attached.
Attached Images
File Type: jpg Test.jpg (165.3 KB, 17 views)
Reply With Quote
  #6  
Old 02-10-2025, 01:31 PM
macropod's Avatar
macropod macropod is offline Picking up trailing space before quotation mark Windows 10 Picking up trailing space before quotation mark Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,465
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

There are only two reasons it wouldn't find anything:
1. You don't have any content like "political agenda ".; or
2. You didn't check the 'Use wildcards' option.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
quotation mark, replace, wildcard



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and replace paragraph mark on selected text and replace it with space in PowerPoint VBA laith93 PowerPoint 0 11-09-2023 04:34 AM
Trim trailing space macro stopped working jec1 Word VBA 2 08-01-2021 11:32 PM
Picking up trailing space before quotation mark Replace space with paragraph mark jeffreybrown Word VBA 8 08-22-2018 03:31 PM
Picking up trailing space before quotation mark Em dash and closing curly quotation mark lexsper Word 3 04-07-2015 07:12 AM
Can't find space before closing quotation marks wardw Word 7 01-16-2014 12:13 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:03 AM.


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