Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-10-2014, 04:10 PM
rsrasc rsrasc is offline Need Short Macro-Find and Replace Windows 7 64bit Need Short Macro-Find and Replace Office 2010 64bit
Competent Performer
Need Short Macro-Find and Replace
 
Join Date: Mar 2014
Location: Germany
Posts: 148
rsrasc is on a distinguished road
Default Need Short Macro-Find and Replace

Can the below code be summarized with a short code?

Thanks!

PHP Code:
Sub AnswerLetterChange()
'
AnswerLetterChange Macro
'
'
    
Selection.Find.ClearFormatting
    Selection
.Find.Replacement.ClearFormatting
    With Selection
.Find
        
.Text "A:"
        
.Replacement.Text "A."
        
.Forward True
        
.Wrap wdFindContinue
        
.Format False
        
.MatchCase False
        
.MatchWholeWord False
        
.MatchWildcards False
        
.MatchSoundsLike False
        
.MatchAllWordForms False


    End With
    Selection
.Find.Execute Replace:=wdReplaceAll
    With Selection
.Find
        
.Text "B:"
        
.Replacement.Text "B."
        
.Forward True
        
.Wrap wdFindContinue
        
.Format False
        
.MatchCase False
        
.MatchWholeWord False
        
.MatchWildcards False
        
.MatchSoundsLike False
        
.MatchAllWordForms False
    End With
    Selection
.Find.Execute Replace:=wdReplaceAll
    With Selection
.Find
        
.Text "C:"
        
.Replacement.Text "C."
        
.Forward True
        
.Wrap wdFindContinue
        
.Format False
        
.MatchCase False
        
.MatchWholeWord False
        
.MatchWildcards False
        
.MatchSoundsLike False
        
.MatchAllWordForms False
    End With
    Selection
.Find.Execute Replace:=wdReplaceAll
    With Selection
.Find
        
.Text "D:"
        
.Replacement.Text "D."
        
.Forward True
        
.Wrap wdFindContinue
        
.Format False
        
.MatchCase False
        
.MatchWholeWord False
        
.MatchWildcards False
        
.MatchSoundsLike False
        
.MatchAllWordForms False
    End With
    Selection
.Find.Execute Replace:=wdReplaceAll
End Sub 
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Short Macro-Find and Replace Find and Replace Macro amparete13 PowerPoint 3 03-11-2014 05:29 AM
Need Short Macro-Find and Replace Is the following too complex for find/replace macro? bertietheblue Word VBA 12 11-04-2013 05:35 PM
Find - Replace Macro using a table list mdw Word 0 08-01-2013 04:36 PM
macro or find/replace JamesVenhaus Word 2 02-27-2012 03:34 PM
Find and Replace Macro - A Better Way Tribos Word VBA 0 10-08-2008 03:22 AM

Other Forums: Access Forums

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