Excel Macro - Add Appointment To Outlook

bunnos

New Member
Joined
Sep 4, 2014
Messages
1
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
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,215,148
Messages
6,123,300
Members
449,095
Latest member
Chestertim

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top