Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-26-2018, 04:49 PM
macropod's Avatar
macropod macropod is offline Delete the graph based on its character number Windows 7 64bit Delete the graph based on its character number 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 don't even need a macro for that - just an ordinary Find/Replace. For example, to delete paragraphs containing exactly three characters (in addition to the paragraph break), use:


Find = ^p^?^?^?^p
Replace = ^p
or you could use a wildcard Find/Replace with:
Find = ^13[!^13]{3}^13
Replace = ^p

To delete paragraphs containing up to three characters (in addition to the paragraph break), use a wildcard Find/Replace with:
Find = ^13[!^13]{1,3}^13
Replace = ^p
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 02-27-2018, 11:39 PM
puff puff is offline Delete the graph based on its character number Windows 7 64bit Delete the graph based on its character number Office 2013
Advanced Beginner
Delete the graph based on its character number
 
Join Date: Apr 2017
Posts: 60
puff is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
You don't even need a macro for that - just an ordinary Find/Replace. For example, to delete paragraphs containing exactly three characters (in addition to the paragraph break), use:
Find = ^p^?^?^?^p
Replace = ^p
or you could use a wildcard Find/Replace with:
Find = ^13[!^13]{3}^13
Replace = ^p

To delete paragraphs containing up to three characters (in addition to the paragraph break), use a wildcard Find/Replace with:
Find = ^13[!^13]{1,3}^13
Replace = ^p
Thanks! This is very neat! Just a note that the last line should be Replace = ^13
Reply With Quote
  #3  
Old 02-27-2018, 11:40 PM
macropod's Avatar
macropod macropod is offline Delete the graph based on its character number Windows 7 64bit Delete the graph based on its character number 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

Quote:
Originally Posted by puff View Post
Just a note that the last line should be Replace = ^13
No, it shouldn't! You will get very strange document behaviour if you do that.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 02-28-2018, 12:38 AM
puff puff is offline Delete the graph based on its character number Windows 7 64bit Delete the graph based on its character number Office 2013
Advanced Beginner
Delete the graph based on its character number
 
Join Date: Apr 2017
Posts: 60
puff is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
No, it shouldn't! You will get very strange document behaviour if you do that.
Sorry. Yeah, you're right. I tested it on a piece of manually typed very simple text and I did notice that will cause some change in the format.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete the graph based on its character number count a number of cells based on the beginning of a order number Kubi Excel 2 08-06-2017 08:54 PM
Delete the graph based on its character number Delete Character on Single Line Only Tye30 Word VBA 8 04-20-2017 08:40 PM
Delete the graph based on its character number Delete starting number *) and delete Unneeded data in series frustrated teacher Word VBA 5 12-07-2014 06:53 PM
first character NOT Alpha numeric or Tilde (~) delete. ksridh Word VBA 5 03-17-2014 12:45 AM
graph changes number when losing embedded link Alaska1 Excel 0 08-14-2013 11:31 AM

Other Forums: Access Forums

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