How to Export Data from Excel to vCard? (2 Simple Methods)

The article will show you how to create a VCF file from Excel. VCF or vCard files are those types of files that contain a person’s contact information. Although we can create a VCF file by using some Android app, it has some limitations. Using Excel to create VCF files will give you bigger space and also save you a lot of time. In addition to contact information, a VCF file can contain a variety of data on a person. Let’s just continue to this article to see the procedures of creating a VCF file from Excel.


How to Export Excel to vCard: 2 Simple Methods

The dataset contains some peoples’ Name, Mobile number, and Email addresses. We will create vCard files using this data.

how to create vcf file from excel


1. Using Windows Contacts Feature

Windows has its own feature to create vCard files from Excel. But we need to modify the file extension first. Let’s have a look at the description below. Keep in mind that any unnecessary header may cause you problems. So, I’m going to delete the second row of the sheet.

how to create vcf file from excel method 1

Steps:

  • First, go to the File tab.

  • Next, save the file in CSV (Comma delimited) extension.

  • After that, click on the Windows icon on the Start Menu and search for Contacts in the search bar. Click on Contacts.

  • Thereafter, the Contacts folder will open. Select the Import Tab from it.

how to create vcf file from excel method 1

  • Later, select CSV (Comma Separated Values) from the Import to Windows Contacts.
  • Next, click on Import.

  • After that, this command will lead you to the browser options so that you can import your desired file.
  • Select Browse.

  • Thereafter, browse for the CSV file with the contact information that you created previously.
  • Next, click Open.

  • Now, click on the Next button in the CSV Import window.

how to create vcf file from excel method 1

  • After that, you need to Map the column headers. Check Mobile and you will see the Mapping Option.

  • You will see there is a Mobile Phone Select it and click OK.

  • Similarly, map the Email header to E-mail Address and click OK.

  • Later, just click on Finish.

how to create vcf file from excel method 1

This command will convert the CSV file to Windows Contacts format.

  • Let’s open a file from this folder. You can see the Name, Email Address and Cell phone number are in the exact place.

  • Now, we will convert these files to vCard or vCalendar For that purpose, select Export Tab.

  • After that, select vCards (folder of .vcf files).
  • Next, click Export.

how to create vcf file from excel method 1

  • Thereafter, Browse for the folder where these contacts are saved and click OK.

Finally, this operation converts these Contact files to VCF files.

  • Open any of these folders. They basically open with Outlook by default. You can open them in Contacts format too.
  • You can see a summary of the contact information too at the top right side of the window.

how to create vcf file from excel method 1

Thus you can create VCF files from Excel using the Windows Contacts feature.


2. Using VBA to Create VCF File from Excel

We can also use Microsoft Visual Basic for Applications (VBA) to create VCF files. Let’s go through the process below.

Steps:

  • First, go to the Developer Tab and then select Visual Basic.

Using VBA to Create VCF File from Excel

  • After that, the VBA editor will appear. Select Insert >> Module to open a VBA Module.

  • Now, type the following code in the VBA Module.
Sub CreateVCFFromExcel()
    Dim mn_File_Num As Integer
    Dim mn_start_row As Double
    mn_start_row = 2
    mn_File_Num = FreeFile
    mn_Output_Path = ThisWorkbook.Path & "\PhoneAndEmail.VCF"
    Open mn_Output_Path For Output As mn_File_Num
    While VBA.Trim(Sheets("Sheet1").Cells(mn_start_row, 1)) <> ""
        mn_Name = VBA.Trim(Sheets("Sheet1").Cells(mn_start_row, 1))
        mn_Email_Address = VBA.Trim(Sheets("Sheet1").Cells(mn_start_row, 2))
        mn_Mobile_Number = VBA.Trim(Sheets("Sheet1").Cells(mn_start_row, 3))
        Print #mn_File_Num, "BEGIN:VCARD"
        Print #mn_File_Num, "VERSION:3.0"
        Print #mn_File_Num, "FN:" & mn_Name
        Print #mn_File_Num, "EMAIL:" & mn_Email_Address
        Print #mn_File_Num, "TEL;TYPE=CELL;TYPE=PREF:" & mn_Mobile_Number
        Print #mn_File_Num, "END:VCARD"
        mn_start_row = mn_start_row + 1
    Wend
    Close #mn_File_Num
    MsgBox "The Contacts are Saved To: " & mn_Output_Path
End Sub

The code uses the VBA Trim function to separate the Name, Email, and Mobile columns. Then it applies the Print Statement to arrange these data properly in the vCard file. FN: refers to First Name, EMAIL: refers to the position where the Email Address will be saved, and TEL;TYPE=CELL means the phone numbers here are the Cell phone numbers.

  • Next, go back to your sheet and run the Macro.

Using VBA to Create VCF File from Excel

  • After that, a VCF file will be created named PhoneAndEmail in the file path of your Excel workbook.

  • Later, open it with the Windows Contacts.

  • This operation will show you the contact information of the first person in your dataset.

  • Actually, all the contact information of the dataset is stored in the PhoneAndEmail So, if you command Cancel, it will show you the next contact.

  • Similarly, clicking on Cancel will lead you to the next contact, and so on.

Thus you can create VCF files using the VBA.


Practice Section

Here, I’m giving you the dataset of this article so that you can practice these methods on your own and gain expertise.


Download Practice Workbook


Conclusion

In the end, we can consider that you will learn the best possible approaches to create VCF files from Excel after reading this article. If you have any better suggestions or questions or feedback regarding this article, please share them in the comment box. This will help me enrich my upcoming articles.


Export Excel to vCard: Knowledge Hub

<< Go Back to Export Data from Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Meraz Al Nahian
Meraz Al Nahian

Md. Meraz Al Nahian has worked with the ExcelDemy project for over 1.5 years. He wrote 140+ articles for ExcelDemy. He also solved a lot of user problems and worked on dashboards. He is interested in data analysis, advanced Excel, statistics, and dashboards. He also likes to explore various Excel and VBA applications. He completed his graduation in Electrical & Electronic Engineering from Bangladesh University of Engineering & Technology (BUET). He enjoys exploring Excel-related features to gain efficiency... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo