Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating page ranges from list of pages

Status
Not open for further replies.

jcfraun

Technical User
Dec 13, 2008
51
0
0
US
I have a table that has the following fields:

Category
Subcategory
Page

I am creating an index from this table that is grouped by: Category
Subcategory
Page

So, I end up with multiple page numbers for each Category/ Subcategory . I would like to create page ranges from the list of pages (i.e., 1,2,3,4,7,8,10 would become 1-4, 7-8, 10).

I've done ths before in Excel by sorting the list of numbers, looping through and comparing them to see if they are in sequence and then appending them to a text string as appropriate. I don't know Access VBA as well, though. Can anybody provide me with a solution? Thanks!
 
How are ya jcfraun . . .

Can you provide some typical table data for a few category/subcategory ranges?

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top