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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with a range text selection macro

Status
Not open for further replies.

charliew001

Technical User
Jun 4, 2012
8
US
Hi,

First time poster and have very limited programming knowledge. I need help with the below macro to modify it to begin the range with a start word "a." ; I have a lot of multiple choice test questions I need to put into an excel chart and I want to make the formatting easier. Basically, I want the macro to be able to select all text that begins with "a." and ends the selection at the end of the paragraph.

Below macro I was trying to modify.

Sub SelectRange()
Dim rngParagraphs As Range
Set rngParagraphs = ActiveDocument.Range( _
Start:=ActiveDocument.Paragraphs(1).Range.Start, _
End:=ActiveDocument.Paragraphs(4).Range.End)
rngParagraphs.Select
End Sub

thank you all in advance.
 
YUP, by design, 'cuz the OP would need to do something with THAT sPgh in Excel, after it's been reconstructed -- then find the NEXT.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Except the OP was not doing that. He was looking at the result of sPgh, which would be empty.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top