arkadaşlar excelde olan banka ekstresini almak istiyorum. forumu araştırdım. şöyle bir kod var ;
Sub ZCD_28_VERİ_AKTAR()
Dim i As Long, deg As String, sat As Long, deg2, k As Byte, dosya
Range("C9:ER2000").ClearContents
ChDir (ThisWorkbook.Path)
dosya = Application.GetOpenFilename(filefilter:="Metin dosyaları(*.txt),(*.txt)", Title:="c:\ornek.txt")
If dosya = False Then Exit Sub
Sheets("Sayfa1").Select
Application.ScreenUpdating = False
Open dosya For Input As #1
Do While Not EOF(1)
Line Input #1, Kayıt
Satır = Satır + 1
Cells(Satır, 3) = Mid(Kayıt, 1, 6)
Cells(Satır, 4) = Mid(Kayıt, 8, 6)
Cells(Satır, 5) = Convert(Mid(Kayıt, 15, 11))
Cells(Satır, 6) = Convert(Mid(Kayıt, 27, 11))
Cells(Satır, 7) = Convert(Mid(Kayıt, 39, 1))
Cells(Satır, 8).NumberFormat = "@"
Cells(Satır, 8) = Mid(Kayıt, 41, 2)
Loop
Close #1
Cells.EntireColumn.AutoFit
End Sub
Function Convert(Veri As String)
Veri = Replace(Veri, Chr(154), "Ü")
Veri = Replace(Veri, Chr(166), "Ğ")
Veri = Replace(Veri, Chr(158), "Ş")
Veri = Replace(Veri, Chr(128), "Ç")
Veri = Replace(Veri, Chr(153), "Ö")
Veri = Replace(Veri, Chr(152), "İ")
Convert = Replace(Veri, Chr(15), "")
End Function
bu şekilde belirli verileri sınırlı olarak alıyor. benim banka ekstresinde her bir sütun için (
noktalı virgül ayracı koyulmuş bunu nasıl alırız.
Sub ZCD_28_VERİ_AKTAR()
Dim i As Long, deg As String, sat As Long, deg2, k As Byte, dosya
Range("C9:ER2000").ClearContents
ChDir (ThisWorkbook.Path)
dosya = Application.GetOpenFilename(filefilter:="Metin dosyaları(*.txt),(*.txt)", Title:="c:\ornek.txt")
If dosya = False Then Exit Sub
Sheets("Sayfa1").Select
Application.ScreenUpdating = False
Open dosya For Input As #1
Do While Not EOF(1)
Line Input #1, Kayıt
Satır = Satır + 1
Cells(Satır, 3) = Mid(Kayıt, 1, 6)
Cells(Satır, 4) = Mid(Kayıt, 8, 6)
Cells(Satır, 5) = Convert(Mid(Kayıt, 15, 11))
Cells(Satır, 6) = Convert(Mid(Kayıt, 27, 11))
Cells(Satır, 7) = Convert(Mid(Kayıt, 39, 1))
Cells(Satır, 8).NumberFormat = "@"
Cells(Satır, 8) = Mid(Kayıt, 41, 2)
Loop
Close #1
Cells.EntireColumn.AutoFit
End Sub
Function Convert(Veri As String)
Veri = Replace(Veri, Chr(154), "Ü")
Veri = Replace(Veri, Chr(166), "Ğ")
Veri = Replace(Veri, Chr(158), "Ş")
Veri = Replace(Veri, Chr(128), "Ç")
Veri = Replace(Veri, Chr(153), "Ö")
Veri = Replace(Veri, Chr(152), "İ")
Convert = Replace(Veri, Chr(15), "")
End Function
bu şekilde belirli verileri sınırlı olarak alıyor. benim banka ekstresinde her bir sütun için (
