Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-13-2019, 01:48 AM
macropod's Avatar
macropod macropod is offline Automatically Convert Text to Table with unique character as deliminator Windows 7 64bit Automatically Convert Text to Table with unique character as deliminator Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,521
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Well, obviously, you'd only use the process I outlined for the ranges that should be converted to tables, not to the whole document. For a macro, you might try something like:


Code:
Sub Demo()
Application.ScreenUpdating = False
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "?"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    .Execute
  End With
  Do While .Find.Found
    .Paragraphs.First.Range.ConvertToTable Separator:="?", AutoFit:=True, _
      Format:=wdTableFormatList3, AutoFitBehavior:=wdAutoFitContent
    .Collapse wdCollapseEnd
    .Find.Execute
  Loop
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 06-13-2019, 02:13 AM
ghost5 ghost5 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
Novice
Automatically Convert Text to Table with unique character as deliminator
 
Join Date: Jun 2019
Posts: 4
ghost5 is on a distinguished road
Default

Thank you - this looks very good. I just need to do some more formatting at my end before running this.

Is there something that I can add / change to your code that will center align the tables to the document when they are created?
Selecting each individual table will align them but not if I press control+A on the whole document.
Reply With Quote
Reply



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 09:27 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