Const QT_DEST As String = "A1"
Dim sFileName
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = False
.FilterIndex = 6
.InitialFileName = ThisWorkbook.Path
If .Show Then
sFileName = .SelectedItems(1)
End If
End With 'Application.FileDialog(msoFileDialogOpen)
If Not sFileName = vbNullString Then
Range(QT_DEST).CurrentRegion.EntireColumn.Delete
With ActiveSheet.QueryTables.Add(Connection:="TEXT;" & sFileName, Destination:=Range(QT_DEST))
.TextFileParseType = xlDelimited
.TextFileConsecutiveDelimiter = True
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = True
.TextFileDecimalSeparator = "."
.TextFileThousandsSeparator = ","
.Refresh BackgroundQuery:=False
.Delete
End With 'ActiveSheet.QueryTables.Add(Connection:="TEXT;" & sFileName, Destination:=Range(QT_DEST))
Range(QT_DEST).EntireColumn.Delete
End If
End Subcitovat