LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Create Outlook task from Excel Macro?

Jay

You can just test for it. If it's empty do you want to skip the whole row?
Is it if any cells are empty, or one in particular, or is just a blank row?

These lines will skip the Task creation of the cell in column A is empty.


Set olApp = CreateObject("Outlook.Application")

For i = 4 To s.Range("A4").CurrentRegion.Rows.Count
Set c = s.Cells(i, 1)


If Not IsEmpty(c.Value) Then

Set olTsk = olApp.CreateItem(olTaskItem)

With olTsk
.StartDate = c.Value
.Subject = c.Offset(0, 1).Value
.Body = c.Offset(0, 2).Value
.DueDate = c.Offset(0, 5).Value
.Status = olTaskInProgress
.Importance = olImportanceNormal
.Display
End With


End If

Next

Set olTsk = Nothing
Set olApp = Nothing

End Sub


--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com




 
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
How do I create Microsoft Office Outlook Task in Excel 2007? PamSue Excel Discussion (Misc queries) 0 March 18th 10 10:32 PM
Excel macro to create Outlook e-mail Brad Excel Discussion (Misc queries) 2 April 29th 08 03:40 PM
How can i have Excel automatically set an Outlook task? VT Excel Discussion (Misc queries) 0 July 31st 06 11:49 AM
Can I create a button in Excel that generates a task in Outlook? Tio777 Excel Discussion (Misc queries) 1 June 15th 05 03:41 PM
import outlook task to excel stabekk Excel Programming 1 November 18th 03 06:01 PM


All times are GMT +1. The time now is 10:17 PM.

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

About Us

"It's about Microsoft Excel"