Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-13-2019, 12:56 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 Automatically Convert Text to Table with unique character as deliminator

Hi,



I have a piece of software that outputs a report in text format which is a mixture of words and tables. The report uses spaces to make the report look correct and ordered in notepad but when this is copied over to our final report and center aligned it looks like a mess.

I have been using the record macro feature to remove the extra spaces throughout the report and to add a unique character '£' where the deliminator for the tables needs to be.

I can now go through the document and manually select the tables and use the convert text to table feature which works well but I want to automate this process using VBA.

I am thinking of having word VBA to loop through the document, find all sentences / lines that have £ in them, select the line and then convert text to table for that individual line but I cannot find anything on the web like this so I don't know where to start.

I cannot select the whole document and covert it due to it being a mixture of text and tables and some tables having 3 columns and others 7.

This is a sample of the text with £ in it which has the first 5 lines as either text or paragraphs then the rest of the data as a table

Code:
Adjusted Observations and Residuals
===================================

Adjusted Distance Observations (Meters)

From£To£Distance£Residual£StdErr£StdRes£File:Line
SEL01£SEL06£294.3875£-0.0003£0.0015£0.2£1:31
SEL01£SEL02£15.3749£-0.0003£0.0014£0.2£1:32
SEL07£SEL05£307.6708£-0.0001£0.0015£0.0£1:35
SEL07£SEL06£309.3499£-0.0006£0.0015£0.4£1:36
SEL05£SEL07£307.6708£0.0001£0.0015£0.1£1:39
SEL05£SEL04£314.7247£-0.0004£0.0015£0.3£1:40
SEL04£SEL05£314.7247£0.0006£0.0015£0.4£1:43
SEL04£SEL03£52.4068£-0.0001£0.0014£0.1£1:44
SEL03£SEL04£52.3564£0.0006£0.0014£0.4£1:47
SEL03£SEL02£33.3976£0.0005£0.0014£0.4£1:48
Can someone help me to get started with this?

Thanks
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 10:02 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