Hi,
I am an extremely basic user who has managed to get a basic macro together through multiple web searches and am now stuck...
I have dates entered into the following columns in excel: 14,15,16,26,27,28
I have managed to make the macro create appointments for 14,15,16 but not the rest. Also, every time i run the macro it creates a new appointment regardless if one already exists. I saw on this forum about adding a word to another column which the macro searches for and if found doesnt create a new appointment - or something to that extent. Here is what i have:
Sub POATEST()
' Create the Outlook session
Set myOutlook = CreateObject("Outlook.Application")
' Start at row 7
r = 7
Do Until Trim(Cells(r, 1).Value) = ""
For Each cell In Range(Cells(r, 14), Cells(r, 16))
If cell.Value <> "" Or 0 Then
' Create the AppointmentItem
Set myApt = myOutlook.createitem(1)
' Set the appointment properties
myApt.Subject = Cells(r, 1).Value & " " & "Update Due"
myApt.Start = cell.Value
myApt.categories = "Yellow Category"
myApt.ReminderSet = True
myApt.Body = "blah blah blah"
myApt.Save
End If
Next cell
r = r + 1
Loop
End Sub
Please can someone assist by:
1. making it apply for all the columns originally mentioned
2. making it search if an appointment for that item (ie that row) exists - if not, create appt, if so, do not create appt and insert "Yes" in column 29
Thank you in advance
Nic
I am an extremely basic user who has managed to get a basic macro together through multiple web searches and am now stuck...
I have dates entered into the following columns in excel: 14,15,16,26,27,28
I have managed to make the macro create appointments for 14,15,16 but not the rest. Also, every time i run the macro it creates a new appointment regardless if one already exists. I saw on this forum about adding a word to another column which the macro searches for and if found doesnt create a new appointment - or something to that extent. Here is what i have:
Sub POATEST()
' Create the Outlook session
Set myOutlook = CreateObject("Outlook.Application")
' Start at row 7
r = 7
Do Until Trim(Cells(r, 1).Value) = ""
For Each cell In Range(Cells(r, 14), Cells(r, 16))
If cell.Value <> "" Or 0 Then
' Create the AppointmentItem
Set myApt = myOutlook.createitem(1)
' Set the appointment properties
myApt.Subject = Cells(r, 1).Value & " " & "Update Due"
myApt.Start = cell.Value
myApt.categories = "Yellow Category"
myApt.ReminderSet = True
myApt.Body = "blah blah blah"
myApt.Save
End If
Next cell
r = r + 1
Loop
End Sub
Please can someone assist by:
1. making it apply for all the columns originally mentioned
2. making it search if an appointment for that item (ie that row) exists - if not, create appt, if so, do not create appt and insert "Yes" in column 29
Thank you in advance
Nic