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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top