Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-29-2014, 09:25 AM
rsrasc rsrasc is offline Need Help with Below Code Windows 7 64bit Need Help with Below Code Office 2010 64bit
Competent Performer
Need Help with Below Code
 
Join Date: Mar 2014
Location: Germany
Posts: 148
rsrasc is on a distinguished road
Default Need Help with Below Code

I need some help with the below code. I would like to automate this macro to change numbers with the following format:

0001 to 1.
0002 to 2.

0750 to 750.

Up to maybe 0999

Thanks!!!!


Sub ConvertingNumbers()
'
' ConvertingNumbers Macro
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "0001"
.Replacement.Text = "1."
.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 = "0002"
.Replacement.Text = "2."
.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
Userform Code not quite right - help please vbanovice Word VBA 1 09-29-2013 09:20 PM
outlook vba code help HxG Outlook 0 09-20-2012 10:42 PM
Need Help with Below Code Where does my code go? rbaldwin Word VBA 3 03-14-2012 02:31 PM
Help with VBA Code Modification OTPM Excel Programming 0 09-16-2011 07:10 AM
Need Help with Below Code vbc code rajpeter Excel Programming 2 09-13-2011 02:29 PM

Other Forums: Access Forums

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