Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-02-2020, 01:22 AM
John 4 John 4 is offline Counting the number of changes a macro makes Windows 10 Counting the number of changes a macro makes Office 2013
Advanced Beginner
Counting the number of changes a macro makes
 
Join Date: Oct 2019
Posts: 68
John 4 is on a distinguished road
Default Counting the number of changes a macro makes

Hi fellas,
I'm very sorry to bother you again. I've spent quite a few hours trying to figure this out, but even the simple things are complicated when you're a complete novice. I've tried using the "Dim iCount As Integer" and adding various While/Wends and If/Elses etc in various parts of the macro with the message box at the end to tell me how many changes have been made but I can't get it to work.



Here's a macro to delete the red footnote numbers (and a space after them) from the main text. I've also tried different kinds of execution such as "wdReplaceOne" and putting a simple execute on a loop, but I won't clutter things up by posting numerous failed codes here. I suspect "ReplaceAll" won't be compatible with a counter (but I could be wrong about that too).

Could one of you alter this macro so that it counts the changes. Then I should be able to use that as a guide/template for any other macros.

Thanks once again for your help, and I wouldn't be asking If I hadn't already put considerable effort into figuring it out myself.


Sub DeleteFootnoteNumbers()
Selection.Find.Font.Color = wdColorRed
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^2 "
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
Selection.Find.Execute Replace:=wdReplaceAll
End With
End Sub
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting the number of changes a macro makes need help in counting the number of rows that contain 5 consecutive X Marcia Excel 10 11-25-2018 08:41 PM
Counting the number of changes a macro makes Counting rows with a macro? Jennifer Murphy Word Tables 1 08-23-2016 03:00 PM
Counting the number of changes a macro makes Counting the number of opening of a document sannhei Word 2 03-27-2015 05:40 AM
Counting unique visitors by ward, counting monthly visits by status, editing existing workbook JaxV Excel 9 11-14-2014 12:25 AM
Counting the number of changes a macro makes Counting Number of Months from a static date bremen22 Excel 4 11-25-2013 11:57 AM

Other Forums: Access Forums

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