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.
Download Practice Workbook
2 Efficient Ways to Create VCF File from Excel
The dataset contains some peoples’ Name, Mobile number, and Email addresses. We will create VCF files using this data.
1. Using Windows Contacts Feature
Windows has its own feature to create VCF 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.
- First, go to the File
- Next, save the file in CSV (Comma delimited)
- 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.
- 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.
- 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.
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.
- 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.
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.
- First, go to the Developer Tab and then select Visual Basic.
- 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.
- 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.
Here, I’m giving you the dataset of this article so that you can practice these methods on your own and gain expertise.
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. For more queries, kindly visit our website ExcelDemy.