Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 191
Default 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

Jamie

Macro:

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Splitting data into columns

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?


--


Gary


"Jamie" wrote in message
...
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

Jamie

Macro:

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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 191
Default Splitting data into columns

Cheers for the reply.

I just tried that but it made no difference.

Any other ideas??

"Gary Keramidas" wrote:

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?


--


Gary


"Jamie" wrote in message
...
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

Jamie

Macro:

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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Splitting Numbers into Columns. GEM Excel Discussion (Misc queries) 3 July 1st 09 08:37 PM
help on splitting into columns [email protected] Excel Discussion (Misc queries) 5 November 8th 08 07:58 PM
Splitting Numbers Into Different Columns Peter W Soady \(UK\) Excel Discussion (Misc queries) 3 September 30th 06 07:57 PM
Splitting Names Down Columns Tatakau Excel Programming 4 August 25th 05 02:58 PM
splitting 1 column of data into multiple columns CiceroCF Setting up and Configuration of Excel 1 March 25th 05 01:50 AM


All times are GMT +1. The time now is 06:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"