Get Outlook Data from Picked Folder @Exceltrainingvideos
Get Outlook Data from Picked Folder  @Exceltrainingvideos
Uploaded June 2020 | Updated September 2026, 1 week ago
How to pick a folder from Microsoft Outlook and get the data into an Excel worksheet automatically with vba.
Here's the complete VBA code:
Option Explicit

Sub getDataFromOutlookChoiceFolder()
Dim OutlookApp As Outlook.Application
Dim OutlookNamespace As Namespace
Dim Folder As MAPIFolder
Dim OutlookMail As Variant
Dim i As Long

Set OutlookApp = New Outlook.Application
Set OutlookNamespace = OutlookApp.GetNamespace("MAPI")
Set Folder = OutlookNamespace.pickfolder

If Folder.Items.Count = 0 Then
MsgBox "No emails. Exiting procedure!"
Exit Sub
End If

i = 1

Dim rngName As Name
Sheet1.Cells.Clear
For Each rngName In ActiveWorkbook.Names
rngName.Delete
Next

Range("A1").Name = "email_Subject"
Range("A1") = "EmailSubject"
Range("B1").Name = "email_Date"
Range("B1") = "Email Date"
Range("C1").Name = "email_Sender"
Range("C1") = "Email Sender"
Range("D1").Name = "email_Body"
Range("D1") = "Email Body"
Range("E1").Name = "email_Receipt_Date"
Range("email_Receipt_Date").Value = InputBox("Enter Receipt Date like 20-mar-2020")

For Each OutlookMail In Folder.Items
If OutlookMail.ReceivedTime 'GREATER THAN'= Range("email_Receipt_Date").Value Then
Range("email_Subject").Offset(i, 0).Value = OutlookMail.Subject
Range("email_Subject").Offset(i, 0).Columns.AutoFit
Range("email_Subject").Offset(i, 0).VerticalAlignment = xlTop
Range("email_Date").Offset(i, 0).Value = OutlookMail.ReceivedTime
Range("email_Date").Offset(i, 0).Columns.AutoFit
Range("email_Date").Offset(i, 0).VerticalAlignment = xlTop
Range("email_Sender").Offset(i, 0).Value = OutlookMail.SenderName
Range("email_Sender").Offset(i, 0).Columns.AutoFit
Range("email_Sender").Offset(i, 0).VerticalAlignment = xlTop
Range("email_Body").Offset(i, 0).Value = OutlookMail.Body
Range("email_Body").Offset(i, 0).Columns.AutoFit
Range("email_Body").Offset(i, 0).VerticalAlignment = xlTop

i = i + 1
End If
Next OutlookMail

Set Folder = Nothing
Set OutlookNamespace = Nothing
Set OutlookApp = Nothing

End Sub
Note: Replace 'GREATER THAN' with an angular bracket
Reference: exceltrainingvideos.com/get-data-from-outlook-into-excel-worksheet
Get Outlook Data from Picked FolderDisplay Worksheet Data Quickly and EasilySort Data in Worksheet As We Type AutomaticallyRun Macro when Result of Formula ChangesAutomate Language Translations Using Excel VBAAutomating Analysis of CSV Files with ADO SQLYouTube Shorts Open Any File Using VBA in ExcelExtract Specific Data from MS Word into Excel with VBATREND Function in ExcelConvert Excel Charts to Images Automatically2021 | Recover Data From Protected Excel File| | Using Google SheetsCreate Data Entry Forms under 10 seconds No VBA
Dinesh Kumar Takyar |

Get Outlook Data from Picked Folder

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER