Splitting data into columns



Hi There

I am using the code below to import data from an outlook email into a
spreadsheet. My problem is that all the data gets put into the first column
and each line is seperated by a square box.

Is it possible to either get each line put into a different column or to
write a further macro to split the data up?

Any help would be greatfully appreciated.

Thanks in advance



Sub GetFromInbox()

Dim olApp As Outlook.Application
Dim olNs As NameSpace
Dim Fldr As MAPIFolder
Dim olMail As Variant
Dim i As Integer

Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set Fldr = olNs.GetDefaultFolder(olFolderInbox)
i = 1

For Each olMail In Fldr.Items
If InStr(olMail.Subject, "requestxz") > 0 Then

ActiveSheet.Cells(i, 1).Value = olMail.body
i = i + 1
End If
Next olMail

Set Fldr = Nothing
Set olNs = Nothing
Set olApp = Nothing

End Sub



Gary Keramidas

didn't test it, but did you try reversing the cells(i,1) to cells(1,i), or
whatever row number you want to start in?


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question