Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 04-18-2017, 11:17 AM
Tye30 Tye30 is offline Delete Character on Single Line Only Windows 7 32bit Delete Character on Single Line Only Office 2010 32bit
Novice
Delete Character on Single Line Only
 
Join Date: Apr 2017
Posts: 7
Tye30 is on a distinguished road
Default

Hello macropod,

Thank you for responding to my question! This is what I came up with from your suggestion

Code:
 
Sub TEST_REVISE()
'
'
    Selection.HomeKey Unit:=wdLine
 
    With Selection.Find
        .Replacement.ClearFormatting
        .Text = "^p    |Z| "
        .Replacement.Text = "^pZR"
        .MatchWildcards = False
        .Execute Replace:=wdReplaceOne, Forward:=True, Wrap:=wdFindContinue
    End With
    With Selection.Find
        .Replacement.ClearFormatting
        .Text = "|"
        .Replacement.Text = ""
        .Execute Replace:=wdReplaceOne
    End With
 
        Do While Selection.Find.Found = True And iCount < 13
        iCount = iCount + 1
            With Selection.Find: .Execute Replace:=wdReplaceOne, ReplaceWith:="", _
                     Forward:=True: End With
            'myNumber = myNumber + 1
 
        Loop
 
    Selection.MoveDown Unit:=wdLine, Count:=1
    Selection.HomeKey Unit:=wdLine
 
End Sub
When I run the macro it doesn't actually find the first instant of "^p |Z| " it will skip the line the cursor is on and actually find the line below it. Also, it runs a bit slower at about 26 seconds to execute 100 times vs 3 seconds to execute 100 times.
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 10:20 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