VBA Outlook/Excel

jisoo22
05-04-2001, 12:46 PM
Hello all!

I'm trying to put together a macro that will take information from an email and put it into an excel spreadsheet. Specifically I'm looking for the statement or command that will take a single line of text and stick it into a targeted cell. Does anyone happen to know this?

Thank You

kouzoudis
07-24-2003, 03:25 PM
This message may appear dublicate, I was trying to reply but it seems that I started a new thread, sorry!!!

I have used these lines of code in the past:

Dim xls As Excel.Application
Set xls = CreateObject("Excel.Application")
xls.Visible = False 'Show Excel or run in background
filepath = "c:\file1.xls"
xls.Workbooks.Open filepath
xls.ActiveSheet.Range("A1:A1").Select
'It is always a good idea to select the top-left cell
'To put your line in cell A4
indexRow = 4
xls.ActiveCell.Range("A" & CStr(indexRow)).Value = "Your line of text"
'You can reat the context of the cell in the same way
x = xls.ActiveCell.Range("A" & CStr(indexRow)).Value
xls.Workbooks.Close
Set xls = Nothing

I hope that all this helps

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum