![]() |
|
![]() |
|
Thread Tools | Display Modes |
|
#1
|
||||
|
||||
![]()
While Paul is a whizz with wildcards, based on your comments I would do it differently. If the required paragraphs always begin with four or 6 numeric characters, the required paragraphs can be obtained by analysing those characters at the start of each paragraph e.g.
Code:
Dim oPara As Paragraph Dim oRng As Range For Each oPara In ActiveDocument.Paragraphs If IsNumeric(Left(oPara.Range, 4)) Or IsNumeric(Left(oPara.Range, 6)) Then Set oRng = oPara.Range oRng.End = oRng.End - 1 'do what you want here with orng.text MsgBox oRng.Text End If Next oPara
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#2
|
|||
|
|||
![]()
Hi Graham,
Thank you for this option. The pop-up window doesn't work for this specific issue because I get about 1500 results per report so that's a lot of times to hit the "enter" key ![]() ![]() I was working all weekend so I didn't have much time to work with what you wrote for me but I did want to say thank you and also thank you for all the work you do on your blog. http://www.gmayor.com/replace_using_wildcards.htm is what helped me figure out why I couldn't get Paul's macro to extract what I wanted. You guys are great!! Every time I submit something I learn a ton. Once I have a chance to "play" with what you wrote I'll be back with more questions ![]() Donna |
![]() |
Tags |
excel 2013, extract word to excel, word 2013 |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
aditya_bokade | Word VBA | 28 | 11-13-2021 10:48 PM |
![]() |
caboy | Word VBA | 2 | 04-01-2015 07:00 AM |
![]() |
mohsen.amiri | Word | 2 | 02-19-2015 11:38 PM |
![]() |
Aztec | Word VBA | 2 | 04-02-2013 10:52 PM |
How to import a text file but skip the first line regardless of characters? | omahadivision | Excel Programming | 7 | 02-01-2013 08:30 PM |