Hello
I am using this code in a worksheet to add tasks to outlook from an excel worksheet which works fine....:
However, I would like to know if there is any way that when this Macro is run, it does not add all the tasks on the worksheet again, thus duplicating tasks that have already been added.Sub Macro2() ' ' Macro2 Macro ' Dim olApp As Outlook.Application Dim olTsk As TaskItem Dim w As Workbook Dim s As Worksheet Dim c As Range Set s = Worksheets("Administrator") 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, 3).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
Is there, maybe, a way to do this adding tasks only added on or after 'today'?
I hope someone can help!
Thanks
Dave
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks