Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 11-15-2014, 09:42 AM
rsrasc rsrasc is offline Looking Again for Another Code/Macro Windows 7 64bit Looking Again for Another Code/Macro Office 2010 64bit
Competent Performer
Looking Again for Another Code/Macro
 
Join Date: Mar 2014
Location: Germany
Posts: 148
rsrasc is on a distinguished road
Default

I would like to know if the below code can be modify for the following sequence of numbers in a document. For example:

1.
2.
3.
4.
5.

To start with any number:

To:

11.
12 .
13.
14.
15.

Or start with"

20.
21.
22.
23.
24.

Thanks!

PHP Code:
Sub Demo()
Application.ScreenUpdating False
Dim i 
As Long
CLng(InputBox("Starting#?"))
With ActiveDocument.Range
  With 
.Find
    
.ClearFormatting
    
.Replacement.ClearFormatting
    
.Text "Question #([0-9]@) \(ACCCC*\)"
    
.Replacement.Text ""
    
.Forward True
    
.Wrap wdFindStop
    
.Format False
    
.MatchWildcards True
    
.Execute
  End With
  
Do While .Find.Found
    
.Text Replace(.TextSplit(.Text" ")(1), "#" i)
    
1
    
.Collapse wdCollapseEnd
    
.Find.Execute
  Loop
End With
Application
.ScreenUpdating True
End Sub 
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Style in Use Macro-Need Help Optimizing Code freda0255 Word VBA 4 08-04-2014 07:35 PM
Looking Again for Another Code/Macro VBA Code for adding Macro to QAT OTPM Project 4 08-22-2013 01:33 PM
Need Macro code for Outlook gbaker Outlook 0 04-11-2013 10:29 AM
Looking Again for Another Code/Macro I need help with macro...code needed for automatic sorting chefmate Excel Programming 1 08-26-2012 01:04 AM
Excel 2007 - formula or macro/vba code required wrighty50 Excel Programming 3 05-13-2012 02:24 PM

Other Forums: Access Forums

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