Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 04-26-2011, 08:44 PM
macropod's Avatar
macropod macropod is offline Need help on macro for looping Windows 7 32bit Need help on macro for looping Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,341
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Kilosub,

The code's just a series of wildcard Find/replace operations, using a loop (you said you wanted a loop) to go through a series of them (per the StrFind & StrRep variables) before using two more in linear form for the bolding.

The 'save' message is occuring because of how extensive the changes are. You can probably both eliminate the prompt and make the code run faster by adding the lines:
Application.ScreenUpdating = False
Application.DisplayAlerts = wdAlertsNone
immediately after the line:
Sub StatementReformatter()
and by inserting:
Application.ScreenUpdating = True
before the line:
End Sub

As for the spacing, I simply took that from what you'd posted. If you want to reduce the# of empty lines, go to the line:
StrRep = "^m^p^p^p^p^p^p\1^p^p ...
and decrease the # of '^p' sequences after the '^m'. For example:
StrRep = "^m^p^p^p\1^p^p ...
will halve the amount of white space. Alternatively (or as well), you could reduce the size of your document's top/bottom margins.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Looping Question Steve B PowerPoint 0 01-19-2011 10:44 AM
Looping video tomasball PowerPoint 0 10-30-2010 02:38 PM
Unbreakable looping Dixon Outlook 0 09-23-2009 02:10 PM
Need help on macro for looping How to Advance from Looping SWF Animation? BSquared18 PowerPoint 1 07-04-2009 01:56 PM
Looping though Custom Properties in VBA suekay Misc 0 05-19-2006 06:10 AM

Other Forums: Access Forums

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