burhancavus61
Altın Üye
- Katılım
- 13 Mayıs 2005
- Mesajlar
- 761
- Excel Vers. ve Dili
- 2010 Türkçe
- Altın Üyelik Bitiş Tarihi
- 03.11.2024
Aşağıdaki kod ile veri alıyorum. Ama dosya yolunun seçilebilir olmasını nasıl sağlarım. Dosya yolundan txt dosyasını ben seçebilmeliyim.
Kod:
Sub Veriçek()
Sheets("Veri Al").Select
ActiveSheet.Unprotect "61"
Range("A2").Select
Range(Selection, Selection.End(xlToRight)).Select
Range("A2:CC2").Select
Range(Selection, Selection.End(xlDown)).Select
Range("A2:CC500").Select
' Selection.QueryTable.Delete
Selection.ClearContents
Range("A2").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Puantaj\ANTALYA-01.01.2020-31.01.2020-Puantaj.txt", Destination:= _
Range("$A$2"))
.Name = "ANTALYA-01.01.2020-31.01.2020-Puantaj_2"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 1252
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _
1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
ActiveSheet.Protect "61", DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFiltering:=True
End Sub