Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
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,144
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
 

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 07:57 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