Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-16-2015, 08:22 PM
MrAdamRe MrAdamRe is offline Dates from Excel into Outlook Windows XP Dates from Excel into Outlook Office 2010 64bit
Novice
Dates from Excel into Outlook
 
Join Date: Mar 2015
Location: Sacramento
Posts: 4
MrAdamRe is on a distinguished road
Default Dates from Excel into Outlook


I want to transfer a excel column of about 50 dates directly onto my calendar in outlook. Is that possible?
Reply With Quote
  #2  
Old 03-16-2015, 11:22 PM
gmayor's Avatar
gmayor gmayor is offline Dates from Excel into Outlook Windows 7 64bit Dates from Excel into Outlook Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The short answer is yes, and you can do it from Excel or Outlook, but dates alone aren't going to convey much. What information do you want to add to the appointments?
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 03-16-2015, 11:35 PM
MrAdamRe MrAdamRe is offline Dates from Excel into Outlook Windows XP Dates from Excel into Outlook Office 2010 64bit
Novice
Dates from Excel into Outlook
 
Join Date: Mar 2015
Location: Sacramento
Posts: 4
MrAdamRe is on a distinguished road
Default

I just want it to note that "Payroll Info Due" on each of the dates
Reply With Quote
  #4  
Old 03-17-2015, 12:45 AM
gmayor's Avatar
gmayor gmayor is offline Dates from Excel into Outlook Windows 7 64bit Dates from Excel into Outlook Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

OK - The following should do that
Code:
Sub AddOutlookApptmnt()
Dim xlSheet As Worksheet
Dim olApp As Object
Dim objAppt As Object
Dim strDate As String
Dim strTime As String
Dim datOutlookDate As Date
Dim i As Long
Dim LastRow As Long
    On Error Resume Next
    Set olApp = GetObject(, "Outlook.Application")
    If Err <> 0 Then
        Set olApp = CreateObject("Outlook.Application")
    End If
    On Error GoTo 0

    Set xlSheet = ActiveWorkbook.Sheets(1)
    With xlSheet
        LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
        For i = 2 To LastRow        'Assumes a header row
            strDate = .Cells(i, "A")
            strTime = "07:00"
            datOutlookDate = CDate(strDate & " " & strTime)
            Set objAppt = olApp.CreateItem(1)
            With objAppt
                .Start = datOutlookDate
                .ReminderSet = True
                .AllDayEvent = True
                .Subject = "Payroll Info Due"
                .BusyStatus = 0
                .Save
            End With
        Next i
    End With
lbl_Exit:
    Set olApp = Nothing
    Set objAppt = Nothing
    Exit Sub
End Sub
The code for creating a task, which might be preferable, is similar:
Code:
Sub AddOutlookTask()
Dim xlSheet As Worksheet
Dim olApp As Object
Dim olTask As Object
Dim strDate As String
Dim i As Long
Dim LastRow As Long
    On Error Resume Next
    Set olApp = GetObject(, "Outlook.Application")
    If Err <> 0 Then
        Set olApp = CreateObject("Outlook.Application")
    End If
    On Error GoTo 0

    Set xlSheet = ActiveWorkbook.Sheets(1)
    With xlSheet
        LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
        For i = 2 To LastRow        'Assumes a header row
            strDate = .Cells(i, "A")
            Set olTask = olApp.CreateItem(3)
            With olTask
                .Subject = "Payroll Info Due"
                .StartDate = strDate
                .DueDate = strDate
                .Importance = 2
                '.Categories = "Payroll" 'add a category of your choice
                .Save
            End With
        Next i
    End With
lbl_Exit:
    Set olApp = Nothing
    Set olTask = Nothing
    Exit Sub
End Sub
Both codes run very quickly and nothing may appear to have happened, but check your Outlook
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #5  
Old 03-17-2015, 06:10 AM
MrAdamRe MrAdamRe is offline Dates from Excel into Outlook Windows XP Dates from Excel into Outlook Office 2010 64bit
Novice
Dates from Excel into Outlook
 
Join Date: Mar 2015
Location: Sacramento
Posts: 4
MrAdamRe is on a distinguished road
Thumbs up Dude that Rocks!!!

ahem... Can I just say WOW! I am so impressed. Thank you so much
Reply With Quote
Reply

Tags
excel import



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dates from Excel into Outlook Unable to sort dates in Excel on new PC freebird795 Excel 3 12-07-2014 03:06 PM
Dates from Excel into Outlook Excel is changing dates. laqa Excel 5 11-06-2014 07:26 PM
Dates from Excel into Outlook Grouping Dates in Excel Pivot Table mskennedy Excel 2 02-27-2013 11:09 AM
Dates from Excel into Outlook Excel 2010 - Converting fractions into dates judicial85 Excel 5 12-31-2011 07:59 AM
Dates from Excel into Outlook MS Excel 2004 for Mac - copying dates between documents BCRenton Excel 4 11-10-2009 07:28 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:26 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft