Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 04-19-2017, 12:27 PM
macropod's Avatar
macropod macropod is offline Delete Character on Single Line Only Windows 7 64bit Delete Character on Single Line Only Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,514
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 Tye30 View Post
I think I mislead you in my last post.
Indeed. Try:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim StrTmp As String
With Selection
  .Start = .Paragraphs.First.Range.Start
  .End = .Paragraphs.First.Range.End - 1
  StrTmp = Trim(Replace(Replace(.Text, "|Z|", "ZR"), "|", ""))
  Do While InStr(StrTmp, "  ") > 0
    StrTmp = Replace(StrTmp, "  ", " ")
  Loop
  .Text = StrTmp
End With
Application.ScreenUpdating = True
End Sub
With this code, it will process any paragraph you click in - you don't have to select the entire paragraph beforehand
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete Character on Single Line Only Every page indents first line one character glennhardy Word 6 02-05-2016 04:05 PM
Delete Character on Single Line Only Use character instead of line for table border dlowrey Word Tables 6 03-09-2015 11:29 AM
Delete Character on Single Line Only macro to add brackets to each line and add single quotes to each word in the line bracketandquotes Word VBA 17 02-16-2015 03:51 PM
first character NOT Alpha numeric or Tilde (~) delete. ksridh Word VBA 5 03-17-2014 12:45 AM
Change single character in PPT to another font macro rtwwpad PowerPoint 1 01-19-2013 05:08 PM

Other Forums: Access Forums

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