Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-01-2012, 09:20 PM
ubns ubns is offline Macro - replace with condition Windows 7 32bit Macro - replace with condition Office 2010 32bit
Competent Performer
Macro - replace with condition
 
Join Date: Apr 2012
Posts: 177
ubns is on a distinguished road
Default Macro - replace with condition

Hi

I have the following code which replaces the .00 with blanks (nothing). In otherwords it removes .00 from the document.

But currently it is removing ".00" if it find anywhere such as .008 will change to 8.

I only want to change if ".00" is like 5.00. so only in this case it should remove ".00".


Sub find()
With Selection.find


.Text = ".00"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
'Selection.find.Execute replacewith:="" not required as the code is there.
Selection.find.Execute Replace:=wdReplaceAll
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
macro or find/replace JamesVenhaus Word 2 02-27-2012 03:34 PM
Macro to replace From Address in Outlook RlcZek113524 Outlook 0 06-08-2011 02:20 PM
Macro - replace with condition Macro to Replace Fonts ballj_35 Word 3 05-10-2011 01:10 AM
Macro - replace with condition check with condition karti Word 2 03-15-2011 06:06 AM
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 11:53 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