Office Q&A: Three ways to select all footnotes in a document
Most Word customers be taught rapidly that urgent Ctrl+A selects your complete document—besides headers, footers, footnotes, and endnotes. Rory hoped for a macro that will select and replace the sphere codes in his footnotes. His scheme is a little bit of genius and includes subject codes, hyperlinks, and cross-references. It’s slick, however the subject codes in the footnotes do not replace routinely. Field codes usually do not. You should select them and press F9 to drive them to replace. Selecting every subject code manually is tedious—and happily, pointless, so Rory does not want a macro. There are two ways to select footnotes and replace the fields with out utilizing VBA code. I am going to additionally present a macro, in case that is what Rory really wants.
I am utilizing Word 2016 (desktop), however these strategies will work in earlier variations. The browser model does not show footnotes. We’ll be updating subject codes; if you do not know how to enter subject codes, learn 10 stuff you want to find out about utilizing Word fields. You can observe that article with out studying this text first. For your comfort, you’ll be able to obtain the demonstration Word document and the VBA module.
Perhaps the best manner is to use Ctrl+A. Earlier I stated it does not work with footnotes, but it surely does if you realize this straightforward trick. To see how, we’ll use the fundamental document in Figure A. It comprises two footnotes, and every footnote comprises a NUMPAGES subject. (This subject shows the overall variety of pages in the document.) When you enter every subject code manually, it shows the proper variety of pages. If you add pages, neither updates, as you’ll be able to see in Figure A.
Neither NUMPAGES subject in both footnote updates while you add a new web page.
Now, let’s replace these subject codes as follows:
- Click anyplace inside any footnote in the document.
- Press Ctrl+A to select all footnotes, however solely footnotes (Figure B).
- Press F9 to replace any fields in all the chosen footnotes and click on Yes to see the up to date fields, as proven in Figure C. Word warns you that you would be able to’t undo the motion, however you’ll be able to by urgent Ctrl+Z.
Select all footnotes with Ctrl+A.
Update all the fields in all the footnotes.
It’s like magic! As I stated, most customers find out about Ctrl+A, however they do not notice how versatile it’s.
SEE: 30 issues it is best to by no means do in Microsoft Office (free TechRepublic PDF)
The second methodology has no benefit over the primary, however to be complete, we should always take into account it. This time, we’ll use the Select command. The solely caveat is that your footnotes should use related formatting. In this case, it really works as a result of Word makes use of the Footnote Text model for footnotes. In truth, I elevated the font measurement for the model in the demonstration file in order that they’re simpler to see in the figures.
To proceed, let’s use Select to replace the fields in the footnotes, as follows:
- Click inside any footnote in the document.
- Click the Home tab.
- From the Select dropdown in the Editing group, select Select All Text With Similar Formatting (No Data), as proven in Figure D.
- Press F9 after which click on Yes (as soon as for every footnote, which is a bit tedious).
Select all footnotes utilizing the Select choice.
Rory’s request for a macro is not unfounded. Both guide strategies require that you simply keep in mind to replace the fields. The course of is straightforward, however remembering typically is not. Therefore, a macro is perhaps applicable if you’ll find a manner to name it that you simply will not have to keep in mind, resembling saving, closing, or printing the file.
The macro in Listing A is comparable to the guide Ctrl+A course of. If the Count methodology returns zero, there are not any footnotes and the macro does nothing. When Count returns a worth aside from zero, the If assertion selects all foodnotes. Then, the Update methodology updates the fields. You might use the identical process to select all of the endnotes; merely change the Footnotes assortment with the Endnotes assortment
Sub UpdateFootnotes() 'Update fields in all footnotes. Dim doc As Document Dim rng As Range Set doc = EnergeticDocument If doc.Footnotes.Count <> zero Then 'Select all footnotes. Set rng = doc.Footnotes(1).Range rng.WholeStory rng.Select 'Update all fields. Selection.Fields.Update End If End Sub
To enter the macro, press Alt+F11 to launch the Visual Basic Editor (VBE). In the suitable Word undertaking —select it utilizing the Project Explorer to the left—-open the ThisDocument module and add the code there (Figure E). Note: Don’t copy and paste from this net web page. Enter the code manually or import the code utilizing the downloadable ThisDocument.cls file.
Add the macro to ThisDocument in the VBE.
To run the macro, click on the Developer tab. Then, click on Macros in the Code group. In the ensuing dialog, select UpdateFootnotes (Figure F), click on Run, after which click on Yes to proceed. You can add the macro to the Quick Access Toolbar (QAT), add a macro group to the Ribbon, or discover another inner course of to set off it.
This macro updates all the fields in all footnotes.
Three ways are higher than one
It does not matter which methodology you utilize to replace the fields in the footnotes. What issues is that you’ve a selection! Rory’s pleased with the primary methodology that makes use of Ctrl+A to select solely the footnotes. It’s a neat trick that almost all customers do not find out about.
Send me your query about Office
I reply readers’ questions after I can, however there isn’t any assure. Don’t ship information until requested; preliminary requests for assist that arrive with hooked up information might be deleted unread. You can ship screenshots of your knowledge to assist make clear your query. When contacting me, be as particular as attainable. For instance, “Please troubleshoot my workbook and fix what’s wrong” most likely will not get a response, however “Can you tell me why this formula isn’t returning the expected results?” may. Please point out the app and model that you simply’re utilizing. I am not reimbursed by TechRepublic for my time or experience when serving to readers, nor do I ask for a charge from readers I assist. You can contact me at firstname.lastname@example.org.