How to delete multiple specific pages in a Word document?
In a Word document, you can select the current page content, and then press Delete key to delete the current page easily. But, if you need to remove multiple pages from a large Word file, how could you solve it quickly?
Delete a range of pages in Word document with Go To feature
Delete multiple specific pages in Word document with VBA code
Delete a range of pages in Word document with Go To feature
If you want to delete a range of consecutive pages from a Word document, the Go To feature can do you a favor.
1. Launch the Word document that you want to delete pages.
2. Then press F5 key to open the Find and Replace dialog box, under the Go To tab, click Page in the Go to what list box, and then enter the start page number you want to delete from, and press Enter key to go to the specific page, see screenshot:
2. Then, close this Find and Replace dialog box, and press F8 to turn on the Extend mode.
3. Go on pressing F5 key to open the Find and Replace dialog, this time, enter the end page number that you want to delete, and then press Enter key. All pages from 15 to 20 have been selected at once. See screenshot:
4. At last, press Delete key directly to delete these pages at once.
Delete multiple specific pages in Word document with VBA code
To delete multiple specific pages in a Word file which are non-consecutive, the following VBA code can help you.
1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and paste the following code in the Module Window.
VBA code: Delete multiple specific pages in Word file:
Sub DeletePagesInDoc()
Dim xRange As Range
Dim xPage As String
Dim xDoc As Document
Dim xArr
Dim I, xSplitCount As Long
Application.ScreenUpdating = False
Set xDoc = ActiveDocument
xPage = InputBox("Enter the page numbers of pages to be deleted: " & vbNewLine & _
"use comma to separate numbers", "KuTools for Word", "")
xArr = Split(xPage, ",")
xPageCount = UBound(xArr)
For I = xPageCount To 0 Step -1
Selection.GoTo wdGoToPage, wdGoToAbsolute, xArr(I)
xDoc.Bookmarks("\Page").Range.Delete
Next
Application.ScreenUpdating = True
End Sub
3. Then, press F5 key to run this code, and a prompt box is popped out to remind you enter the page numbers that you want to delete, please separate the page numbers by comma, see screenshot:
4. And then, click OK button, all the pages you specified have been deleted at once.
Select multiple sepecific pages and then delete them at once:
If you want to delete multiple specifiic pages from a large Word document, Kutools for Word's Select Pages feature can help you to select any pages first as you need, and then press Delete key to delete them at once. Kutools for Word: with more than 100 handy Word add-ins, free to try with no limitation in 60 days. Click to Download and free trial Now! |
Best Office Productivity Tools
Kutools for Word - Elevate Your Word Experience with Over 100 Remarkable Features!
Dive into the highlighted features below or click here to explore the full power of Kutools for Word.
📘 Document Mastery: Split Pages / Merge Documents / Export Selection in Various Formats (PDF/TXT/DOC/XLSX) / Batch Convert to PDF / Export Pages as Images / Print Multiple Files at once ...
✏ Contents Editing: Batch Find and Replace across Multiple Files / Resize All Pictures / Transpose Table Rows and Columns / Convert Table to Text ...
🧹 Effortless Clean: Sweap away Extra Spaces / Section Breaks / All Headers / Text Boxes / Hyperlinks / For more removing tools, head to our Remove Group
➕ Creative Inserts: Insert Thousand Separators / Check Boxes / Radio Buttons / QR Code / Barcode / Diagonal Line Table / Equation Caption / Image Caption / Table Caption / Multiple Pictures / Discover more in our Insert Group
🔍 Precision Selections: Pinpoint specific pages / tables / shapes / heading paragraphs / Navigate with ease using our Select Group
⭐ Star Enhancements: Navigate swiftly to any location / auto-insert repetitive text / seamlessly toggle between document windows / 11 Conversion Tools ...
Transform your Word tasks with Kutools. 👉 Download with 30-day trial Now 🚀.
