Link to home
Start Free TrialLog in
Avatar of Rex
RexFlag for United States of America

asked on

Parse email body text into Excel cells

Looking for VBA Code to Parse Variable Length List into a Table

The text (from the Body of an email) looks like this... I want to extract that into individual cells in Excel

PALLET ID             LABEL CREATION TIME            NET WEIGHT
---------------------------------------------------------------
125640400926          15-AUG-18 20:33:34.0              1091
125640400933          15-AUG-18 22:23:34.0              1091
125640400938          16-AUG-18 00:19:51.0              1091
125640400944          16-AUG-18 01:29:01.0              1091
125640400951          16-AUG-18 03:35:05.0              1091
125640400956          16-AUG-18 04:37:27.0              1091
125640400961          16-AUG-18 05:50:58.0              1091
125640400972          16-AUG-18 08:05:38.0              1091
ASKER CERTIFIED SOLUTION
Avatar of ScriptAddict
ScriptAddict
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Norie
Norie

That should be straightforward, if the data is as displayed all you should need is the Split function to get the data for each row then each field.

Do you already have code to get the body of the email?

Where would the data go in Excel, a new workbook or an existing workbook?
If the email is text (not html) and all your column widths are fixed, you could easily replace the spaces using SUBSTITUTE and use MID to grab your column data...without using VBA.  Just a thought.