Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-06-2024, 07:09 PM
GarryGS GarryGS is offline Word macro to auto add page ranges to a doc index Windows 10 Word macro to auto add page ranges to a doc index Office 2021
Novice
Word macro to auto add page ranges to a doc index
 
Join Date: Mar 2024
Posts: 1
GarryGS is on a distinguished road
Default Word macro to auto add page ranges to a doc index

Hi All:


In an index, Word will only make page ranges instead of individual page numbers (24-28, instead of 24,25,26,27,28) if you use bookmarks. Very tedious, especially with the large index I am producing.


I want to convert the generated index to text (Ctrl shift F9), then run a macro on it to transform, say, "24,25,26,27,28" to "24-28" in each entry. Of course, each entry will have different page numbers to convert.



Has anyone made a macro to do this? I could give it a go, but it is at the limit of my VBA skills. It must involve iterating through the page numbers of each index entry, testing if page number n+1 is one different from page number n, then constructing a suitable string.



Thank you for your time,
Garry
Reply With Quote
Reply

Tags
index, page range

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Word macro to auto add page ranges to a doc index Macro to generate an index with page numbers lovexlyn Word VBA 5 11-23-2022 05:32 AM
Word macro to auto add page ranges to a doc index Macro to auto-save pdf using text on page + current date hysterical.useless Word VBA 12 02-05-2018 02:17 PM
Word macro to auto add page ranges to a doc index Auto section break macro - want to have no header on first page of document cspeid03 Word 1 05-17-2017 12:18 PM
Word macro to auto add page ranges to a doc index Index match two date ranges toddkad Excel 9 11-03-2016 03:10 AM
Auto Index is not completing - not taking a second page Clock Word 1 12-12-2014 08:15 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:12 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft