Avatar of Rex
Rex
Flag 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
* ExcdVBAMicrosoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
reitzen

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
ScriptAddict

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
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?
reitzen

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.
Your help has saved me hundreds of hours of internet surfing.
fblack61