ExcelmacrosCSV问题

即时通讯使用一个Excel的macros,它生成一个CSV文件与我所有的数据上传到Gmail作为联系人。 当file upload到Gmail联系人时,手机号码和工作号码正确,但人员姓名作为“名字:Yash”进入笔记框。 我附加一个由macros生成的示例CSV文件。

在这里下载示例CSV

即时通讯使用下面的macros来生成CSV的:

Sub getcsv() Application.ScreenUpdating = False csvnewsheet Dim myRange As Range Dim NumRows As Integer Set myRange = ActiveSheet.Range("A:A") NumRows = Application.WorksheetFunction.CountA(myRange) Range("E1").Select ActiveCell.FormulaR1C1 = "First Name" Range("E2").Select ActiveCell.FormulaR1C1 = "=CONCATENATE(Reports!R[5]C2,"" "",Reports!R[5]C1)" Range("E2").Select Selection.AutoFill Destination:=Range("E2:E" & NumRows + 1) Range("E2:E3").Select Columns("E:E").EntireColumn.AutoFit hide_format Exporttocsv DelSht Application.ScreenUpdating = True End Sub Sub hide_format() ' ' hides name & place columns and then removed the formatting ' ' Columns("A:A").Select Selection.Delete Shift:=xlToLeft Selection.Delete Shift:=xlToLeft Columns("C:C").Select Selection.Cut Columns("A:A").Select Selection.Insert Shift:=xlToRight Range("A1").Select Range(Selection, Selection.End(xlDown)).Select Range(Selection, Selection.End(xlToRight)).Select Selection.Borders(xlDiagonalDown).LineStyle = xlNone Selection.Borders(xlDiagonalUp).LineStyle = xlNone Selection.Borders(xlEdgeLeft).LineStyle = xlNone Selection.Borders(xlEdgeTop).LineStyle = xlNone Selection.Borders(xlEdgeBottom).LineStyle = xlNone Selection.Borders(xlEdgeRight).LineStyle = xlNone Selection.Borders(xlInsideVertical).LineStyle = xlNone Selection.Borders(xlInsideHorizontal).LineStyle = xlNone With Selection.Interior .Pattern = xlNone .TintAndShade = 0 .PatternTintAndShade = 0 End With End Sub Sub csvnewsheet() Dim myRange As Range Dim NumRows As Integer Set myRange = Worksheets("Reports").Range("A:A") NumRows = Application.WorksheetFunction.CountA(myRange) + 3 Sheets.Add.Name = Worksheets("Reports").Range("A2").Value & "_CSV" Worksheets("Reports").Range("A6:D" & NumRows).Copy Destination:=Worksheets(Worksheets("Reports").Range("A2").Value & "_CSV").Range("A1") Worksheets(Worksheets("Reports").Range("A2").Value & "_CSV").Columns("A:D").AutoFit End Sub Sub Exporttocsv() Dim MyPath As String Dim MyFileName As String MyFileName = Worksheets("Reports").Range("A2").Value & "_CSV" If Not Right(MyFileName, 4) = ".csv" Then MyFileName = MyFileName & ".csv" Worksheets(Worksheets("Reports").Range("A2").Value & "_CSV").Copy With Application.FileDialog(msoFileDialogFolderPicker) .Title = "Select a Folder to Save the CSV" .AllowMultiSelect = False .InitialFileName = "" '<~~ The start folder path for the file picker. If .Show <> -1 Then GoTo NextCode MyPath = .SelectedItems(1) & "\" End With NextCode: With ActiveWorkbook .saveas Filename:=MyPath & MyFileName, FileFormat:=xlCSV, CreateBackup:=False .Close False End With End Sub Sub DelSht() Application.DisplayAlerts = False Sheets(Worksheets("Reports").Range("A2").Value & "_CSV").Delete Application.DisplayAlerts = True End Sub 

这个macros将生成一个新的数据表,然后将执行所需的更改并保存为CSV,然后删除该表。

我不知道我会去哪里错…但联系人的名字只是不来gmail … ive尝试了各种其他方法,但它仍然没有工作…

请帮忙!

这就是Gmailbuild议csv文件的格式。

Gmail CSV

这是你如何格式化你的。

在这里输入图像说明

您可能必须按照Gmailbuild议的格式进行格式化。