Hocam merhaba,
001,00001,1 2022/06/21 09:59:43 000
cihazno, sicilno, gc, gtarih, gsaat, nedeni
Saygılarımla,
Ahmet Yenginoğlu
Sub OpenTextFileTest()
On Error GoTo ErrHandler
Dim yol As String
Dim Response As Variant
Dim strTextLine As String
Dim tmpdz As Variant
Dim sonuc As String
Dim iFile As Integer
yol = getFileName
Response = MsgBox("Dosya bulundu verileri yüklemek ister misiniz?", vbYesNo, "UYARI")
If Response = vbNo Then Exit Sub
iFile = FreeFile
Open yol For Input As #iFile
Do Until EOF(iFile)
Line Input #iFile, strTextLine
tmpdz = Split(strTextLine)
sonuc = tmpdz(0) & ",#" & tmpdz(1) & "#,#" & tmpdz(2) & "#"
ThisWorkbook.Sheets("Sheet1").Range("A1").CurrentRegion.ListObject.ListRows.Add AlwaysInsert:=True
ThisWorkbook.Sheets("Sheet1").Range("A1:C1").Value = Split(sonuc, ",")
Loop
Close #iFile
MsgBox "bitti"
ErrHandler:
If Err.Number = 62 Then
MsgBox "Belirttiğiniz dosya boş", vbOKOnly, "UYARI"
End If
End Sub