Arkadaslar Merhaba , dir fonksiyonu hakkında bir sorum olacak . Yardımınızı rica ederim. Dosya yolunu LResult adlı değişken' e aşağıdaki gibi tanımladığımda
Dim LResult As String
LResult = "C:\Users\hoguz2\Desktop\okan\P000753288_20170417.t xt"
kod çalışıyor fakat aşağıdaki gibi yapmak isteyince çalışmıyor.
Dim LResult As String
LResult = Dir("C:\Users\hoguz2\Desktop\okan\P000753288*.txt")
yanlış nerede nasıl düzeltilir..
kodun tamamı aşağıdaki gibi
Kod:
Sub dosyadanal()
On Error GoTo sonsatir
Dim LResult As String
LResult = Dir("C:\Users\hoguz2\Desktop\okan\P000753288*.txt")
satir = 1
Open LResult For Input As 1
Do While Not EOF(1)
Line Input #1, kayit1
If kayit1 <> Empty Then
Cells(satir, 1) = kayit1
satir = satir + 1
End If
Loop
Close #1
End If
Exit Sub
sonsatir:
MsgBox ("HATA OLUŞTU")
End Sub
iyi çalışmalar
Dim LResult As String
LResult = "C:\Users\hoguz2\Desktop\okan\P000753288_20170417.t xt"
kod çalışıyor fakat aşağıdaki gibi yapmak isteyince çalışmıyor.
Dim LResult As String
LResult = Dir("C:\Users\hoguz2\Desktop\okan\P000753288*.txt")
yanlış nerede nasıl düzeltilir..
kodun tamamı aşağıdaki gibi
Kod:
Sub dosyadanal()
On Error GoTo sonsatir
Dim LResult As String
LResult = Dir("C:\Users\hoguz2\Desktop\okan\P000753288*.txt")
satir = 1
Open LResult For Input As 1
Do While Not EOF(1)
Line Input #1, kayit1
If kayit1 <> Empty Then
Cells(satir, 1) = kayit1
satir = satir + 1
End If
Loop
Close #1
End If
Exit Sub
sonsatir:
MsgBox ("HATA OLUŞTU")
End Sub
iyi çalışmalar
