View Single Post
 
Old 08-29-2020, 01:00 PM
John 4 John 4 is offline Windows 10 Office 2013
Advanced Beginner
 
Join Date: Oct 2019
Posts: 69
John 4 is on a distinguished road
Default Modify macro to move only Blue font footnotes into the Text

Hi,
I received the following macro on these forums for moving the footnotes into the text and it works very well. However I'd like to modify it so that it only moves footnotes that are in a certain font colour (blue for example), and leaves the other footnotes unmoved. Can anyone help?

Thanks for your time.

Sub MoveFootnotesIntoText()
Application.ScreenUpdating = False
Dim RngSrc As Range, RngTgt As Range, f As Long
With Selection
For f = .Footnotes.Count To 1 Step -1
With .Footnotes(f)
Set RngSrc = .Range
Set RngTgt = .Reference
RngSrc.End = RngSrc.End - 1
RngTgt.Collapse wdCollapseStart
RngTgt.FormattedText = RngSrc.FormattedText
.Delete
Next
End With
Set RngSrc = Nothing: Set RngTgt = Nothing
Application.ScreenUpdating = True
End Sub
Reply With Quote