![]() |
|
#1
|
|||
|
|||
|
Upgraded to Word 2013 from Word 2010 and the time to execute this macro went form 8 seconds to 208 seconds. When I run the code with not using Code:
Application.ScreenUpdating = False I am a beginner in VBA and I got this code from online Code:
Dim StartTime As Double
Dim SecondsElapsed As Double
StartTime = Timer
Application.ScreenUpdating = False
Dim oPara As Paragraph
For Each oPara In ActiveDocument.Paragraphs
If InStr(1, oPara.Range.Text, "!Z! !") = 0 Then
oPara.Range.Delete
End If
Next
With ActiveDocument.Range.Find
.Replacement.ClearFormatting
.Text = "!"
.Replacement.Text = "|"
.MatchWildcards = False
.Execute Replace:=wdReplaceAll, Forward:=True, Wrap:=wdFindContinue
End With
Application.ScreenUpdating = True
SecondsElapsed = Round(Timer - StartTime, 2)
MsgBox "This code ran successfully in " & SecondsElapsed & " seconds", vbInformation
Last edited by Tye30; 06-21-2017 at 06:25 AM. Reason: Add attachment |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Excel 2013 two laptops near identical spec performing differently | mobile | Excel | 6 | 04-04-2016 03:39 AM |
Copy macro/template from Word 2013 to 365
|
saclucas | Word VBA | 1 | 02-18-2016 09:19 PM |
Word 2013: Hotkey to call a macro
|
arjfca | Word | 2 | 12-04-2014 12:53 AM |
Macro not Performing Formula Update as Expected
|
tandchas | Excel Programming | 7 | 06-27-2014 05:42 AM |
Question about macro in word 2013
|
tombags | Word | 1 | 06-25-2014 04:56 PM |