@souzadenilson
Experimente substituir a macro Importa_ArquivoCSV existente no módulo, pela macro abaixo :
Sub Importa_ArquivoCsv()
'Pra mais detalhes veja o Post que originou essa dúvida
'http://www.mabesi.com/forum/excel/475-importar-arquivo-csv-no-excel-2010.html
Dim csvFileName As String
Dim destCell As Range, lr, i As Long
Dim caixaArquivoCSV As Office.FileDialog
Set caixaArquivoCSV = Application.FileDialog(msoFileDialogFilePicker)
With caixaArquivoCSV
.AllowMultiSelect = False
.Filters.Clear
.Filters.Add "CSV Files", "*.csv"
.InitialFileName = ThisWorkbook.Path
.InitialView = msoFileDialogViewList
.Title = "Select CSV File"
.Show
End With
If caixaArquivoCSV.SelectedItems.Count = 1 Then
Set destCell = Worksheets("ArquivoImportado").Cells(Rows.Count, "b").End(xlUp).Offset(1)
csvFileName = caixaArquivoCSV.SelectedItems(1)
Application.ScreenUpdating = False
With destCell.Parent.QueryTables.Add(Connection:="TEXT;" & csvFileName, Destination:=destCell)
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileSemicolonDelimiter = True
.TextFileDecimalSeparator = ","
.Refresh BackgroundQuery:=False
End With
destCell.Parent.QueryTables(1).Delete
Application.ScreenUpdating = True
End If
End Sub
Favor, teste e retorne.
Espero ter ajudado.
Abs.
Saulo Robles
Postado : 06/09/2020 1:51 am