The lookup table contains IDs from 1 to 20. Non-matching are the rows with the key values that are not present in your main worksheet.įor example, you match tables by the column with IDs.
Please note that the values in these columns are only compared you will be able to select the columns to update on the next step. Key columns are the important ones that let you identify the same records in your sheets, for example, IDs or the combination of First and Last names. Your tables may have several columns in common. You can edit the range by clicking the Select range icon or simply using your mouse cursor to select it in your table.Ĭlick Next to continue. And then, click OK button, all the pages you specified have been deleted at once.Tip. 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:Ĥ. Selection.GoTo wdGoToPage, wdGoToAbsolute, xArr(I)ģ. "use comma to separate numbers", "KuTools for Word", "") XPage = InputBox("Enter the page numbers of pages to be deleted: " & vbNewLine & _ VBA code: Delete multiple specific pages in Word file: Sub DeletePagesInDoc()
Click Insert > Module, and paste the following code in the Module Window. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.Ģ. To delete multiple specific pages in a Word file which are non-consecutive, the following VBA code can help you.ġ. At last, press Delete key directly to delete these pages at once. All pages from 15 to 20 have been selected at once. 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. Then, close this Find and Replace dialog box, and press F8 to turn on the Extend mode.ģ. 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:Ģ. Launch the Word document that you want to delete pages.Ģ. If you want to delete a range of consecutive pages from a Word document, the Go To feature can do you a favor.ġ. But, if you need to remove multiple pages from a large Word file, how could you solve it quickly?ĭelete a range of pages in Word document with Go To featureĭelete multiple specific pages in Word document with VBA code In a Word document, you can select the current page content, and then press Delete key to delete the current page easily.
How to delete multiple specific pages in a Word document?