1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
Private Sub CommandButton1_Click()
'Variables declaration
Dim vFileName As Variant 'For the selection of the file
Dim WkbS As Workbook 'Workbook Source.xls
'Data extraction from .txt
Set WkbS = ThisWorkbook
vFileName = Application.GetOpenFilename
If vFileName = False Then
Else
Workbooks.OpenText Filename:=vFileName, _
Origin:=xlMSDOS, StartRow:=1, DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, _
Tab:=True, Semicolon:=False, Comma:=False, Space:=False, Other:=False, _
DecimalSeparator:=".", ThousandsSeparator:=",", TrailingMinusNumbers:=True
End If
End Sub |
Partager