Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 06-13-2019, 04:12 AM
gmayor's Avatar
gmayor gmayor is offline Automatically Convert Text to Table with unique character as deliminator Windows 10 Automatically Convert Text to Table with unique character as deliminator Office 2016
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

Based on Paul's code you could use the following which will centre the table contents

Code:
Sub Demo2()
Dim oTable As Table
    Application.ScreenUpdating = False
    With ActiveDocument.Range
        With .Find
            .ClearFormatting
            .Replacement.ClearFormatting
            .Text = "£"
            .Forward = True
            .Wrap = wdFindStop
            .Format = False
            .MatchCase = False
            .MatchWholeWord = False
            .MatchWildcards = False
            .MatchSoundsLike = False
            .MatchAllWordForms = False
            .Execute
        End With
        Do While .Find.Found
            Set oTable = .Paragraphs.First.Range.ConvertToTable _
                         (Separator:="£", AutoFit:=True, _
                          Format:=wdTableFormatList3, _
                          AutoFitBehavior:=wdAutoFitContent)
            oTable.Range.ParagraphFormat.Alignment = wdAlignParagraphCenter
            .Collapse wdCollapseEnd
            .Find.Execute
        Loop
    End With
    Application.ScreenUpdating = True
End Sub
__________________
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically Convert Text to Table with unique character as deliminator Row seperator control character in Text To Table AndreQ Word Tables 2 04-12-2019 07:23 AM
How to convert VLOOKUP values to text on another sheet AUTOMATICALLY Lady18 Excel 5 09-10-2016 03:12 AM
Automatically Convert Text to Table with unique character as deliminator How to convert VLOOKUP values to text on another sheet AUTOMATICALLY Lady18 Excel 1 09-10-2016 12:15 AM
Convert Text To Table: Separate text at (Other)? tinfanide Word VBA 2 01-12-2015 05:26 AM
Convert graphic to text in a table Jennifer Murphy Word 6 01-24-2013 12:56 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:50 PM.


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