Aynı klasör içinde listelenmiş birden çok .txt,.xsr,.csv vb. uzantılı metin dosyalarını excele tablo olarak nasıl aktarabilir. Bir tane olduğu zaman yapıyorum ama otomatik dosyayı çağırıp , excel çalışma sayfasına da çağrılan dosyaya uygun bir isim verirse harika olur. Yardımcı olmak isteyenlere teşekkür ederim.
Makro:
Makro:
Kod:
Sub Makro1()
'
' Makro1 Makro
'
'
ActiveWorkbook.Worksheets.Add
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Users\Admin\Desktop\aktarma\liste (1).xsr", Destination:=Range( _
"$A$1"))
.CommandType = 0
.Name = "liste (1)"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 1254
.TextFileStartRow = 1
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1)
.TextFileFixedColumnWidths = Array(16, 8, 10, 19, 10)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub