select text to end of section

B

Blake

In part of a macro I would like to select all text to the
end of a section. How can I do this? Is there a
combination of shortcut keys that will accomplish this?

Thanks for any help
Blake
 
P

Peter Hewett

Hi Blake

I don't know of a keyboard shortcut that will do what you want but the code's a no
brainer:

Public Sub SelectToEndOfSection()
Selection.End = Selection.Sections(1).Range.End
End Sub

The code selects from the start of the current selection to the end of the first section
containing the selection. If the selection includes more than one section, it will end at
the end of the first section.

HTH + Cheers - Peter
 
Top