Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-16-2015, 11:02 PM
gmayor's Avatar
gmayor gmayor is offline Extract Line of Text w/ specific characters up to the paragraph character, send to Excel Windows 7 64bit Extract Line of Text w/ specific characters up to the paragraph character, send to Excel Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,142
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #2  
Old 07-19-2015, 09:03 PM
dmarie123 dmarie123 is offline Extract Line of Text w/ specific characters up to the paragraph character, send to Excel Windows 8 Extract Line of Text w/ specific characters up to the paragraph character, send to Excel Office 2013
Novice
Extract Line of Text w/ specific characters up to the paragraph character, send to Excel
 
Join Date: Dec 2012
Location: New Yuk
Posts: 23
dmarie123 is on a distinguished road
Default

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 . Initially I thought the pop-up was the best option but there aren't any other 12 digit numbers in the report, lucky for me.

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 Thanks again!
Donna
Reply With Quote
Reply

Tags
excel 2013, extract word to excel, word 2013



Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract Line of Text w/ specific characters up to the paragraph character, send to Excel How to insert paragraph character after every 500 characters? aditya_bokade Word VBA 28 11-13-2021 10:48 PM
Extract Line of Text w/ specific characters up to the paragraph character, send to Excel Macro to Insert text into the beginning on specific paragraphs unless the paragraph is blank caboy Word VBA 2 04-01-2015 07:00 AM
Extract Line of Text w/ specific characters up to the paragraph character, send to Excel How can select from a specific character to another character mohsen.amiri Word 2 02-19-2015 11:38 PM
Extract Line of Text w/ specific characters up to the paragraph character, send to Excel Replace paragraph-marks (line-breaks) in tables with a character-string 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

Other Forums: Access Forums

All times are GMT -7. The time now is 06:13 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft