L
littlegreenmen1
I am a contractor and have a schedule in Excel for each of the house
I'm building. As it is right now, I have a macro that exports all th
relevant information from each of my schedules (one at a time) an
imports it into Outlook. This works just fine. My problem is, I have s
much information on one calendar that it makes it hard to read. I hav
setup Outlook Calendar to have a different calendar for each job. Ho
do I get Excel to send the schedule to it's approriate Calendar (ie
the Excel schedule for 123 Anywhere St would be copied to the Outloo
Calendar for 123 Anywhere St and not the default calendar). Below is m
existing code that will export everything into just the defaul
calendar. Thank you for any and all help.
Sub Calendar()
Dim olApp As Object
Dim olApt As Object
Dim x As Integer
Dim olBody As Range
Dim olSubject As Range
Dim olDate As Range
Dim olAddress As Range
EraseCalendar
For x = 3 To 200
Set olSubject = Sheet1.Cells.Item(x, "B")
Set olNotes = Sheet1.Cells.Item(x, "J")
Set olDate = Sheet1.Cells.Item(x, "C")
Set olAddress = Sheet1.Cells.Item(1, "O")
Set olApp = CreateObject("Outlook.application")
Set olApt = olApp.CreateItem(1)
If olDate = "" Then
Exit For
End If
If olSubject = "Start Date" Then
GoTo Label1
End If
If olDate = "Date Required" Then
GoTo Label1
End If
If olDate < Date Then
GoTo Label1
End If
With olApt
.AllDayEvent = True
.Start = olDate
.Subject = olSubject
.Location = olAddress
.Categories = olAddress
.Body = olNotes
.BusyStatus = 0
.ReminderSet = False
.Save
End With
Set olApp = Nothing
Set olApt = Nothing
Label1:
Next x
End Su
I'm building. As it is right now, I have a macro that exports all th
relevant information from each of my schedules (one at a time) an
imports it into Outlook. This works just fine. My problem is, I have s
much information on one calendar that it makes it hard to read. I hav
setup Outlook Calendar to have a different calendar for each job. Ho
do I get Excel to send the schedule to it's approriate Calendar (ie
the Excel schedule for 123 Anywhere St would be copied to the Outloo
Calendar for 123 Anywhere St and not the default calendar). Below is m
existing code that will export everything into just the defaul
calendar. Thank you for any and all help.
Sub Calendar()
Dim olApp As Object
Dim olApt As Object
Dim x As Integer
Dim olBody As Range
Dim olSubject As Range
Dim olDate As Range
Dim olAddress As Range
EraseCalendar
For x = 3 To 200
Set olSubject = Sheet1.Cells.Item(x, "B")
Set olNotes = Sheet1.Cells.Item(x, "J")
Set olDate = Sheet1.Cells.Item(x, "C")
Set olAddress = Sheet1.Cells.Item(1, "O")
Set olApp = CreateObject("Outlook.application")
Set olApt = olApp.CreateItem(1)
If olDate = "" Then
Exit For
End If
If olSubject = "Start Date" Then
GoTo Label1
End If
If olDate = "Date Required" Then
GoTo Label1
End If
If olDate < Date Then
GoTo Label1
End If
With olApt
.AllDayEvent = True
.Start = olDate
.Subject = olSubject
.Location = olAddress
.Categories = olAddress
.Body = olNotes
.BusyStatus = 0
.ReminderSet = False
.Save
End With
Set olApp = Nothing
Set olApt = Nothing
Label1:
Next x
End Su