#1
|
|||
|
|||
Is there a way to select an entire list?
Hi, Is there a way to select an entire list? I tried to see the number of items in a list but couldn't see that either. Perhaps because I also have lines that are indented but without numbers? So of a list continue. (The goal is to put a keep with next in the item before the last.) Thanks, Rocky |
#2
|
||||
|
||||
While it's possible, doing so depends on the list being formatted in a predictable way (e.g. via the use of a predefined Style), so the macro can determine where it starts/ends. Things start getting complicated, too, if the list has sub-lists...
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
||||
|
||||
This seems to work for multiple levels of an outline list
Selection.Range.ListFormat.List.Range.Select If you have restarted lists then the selection stays within the one block but if the numbering continues from a previous block then you end up selecting both blocks plus the bit in between. So the macro to add a keep with next to the second last paragraph would be Code:
Sub Mac2() Dim aRng As Range Set aRng = Selection.Range.ListFormat.List.Range If aRng.Paragraphs.Count > 1 Then aRng.Paragraphs(aRng.Paragraphs.Count - 1).KeepWithNext = True End If End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#4
|
|||
|
|||
Thank you.
|
Tags |
list, list number |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Select an entire line (to insert one) | Officer_Bierschnitt | Excel Programming | 3 | 11-06-2015 03:05 AM |
How to select and copy to clipboard an entire document except for a paragraph and keep formatting | TD_123 | Word VBA | 7 | 06-16-2015 03:30 PM |
Can I select the entire second or third level in an org. chart? | blockie | Word | 1 | 08-25-2014 11:19 PM |
Build a document from a set of standard paragraphs by using a tick list to select tho | pete knight | Word | 9 | 11-13-2013 02:05 AM |
Return Entire Row | ibrahimaa | Excel | 3 | 01-10-2012 05:44 AM |