How can I get the last page number of a chapter for a list (ToC)?

Outside of a list, I use \lastpagenumber. 
But that does not work in a list such as the ToC.

Any tips or pointers will be gladly received.

Alan