Merhaba.
Aşağıdaki kodda:
deger1 = Mid(satir, bas, sayi1)
kısmında Run-time error'13':
Type mismatch hatası almaktayım.
Yardımcı olursanız sevinirim.Teşekkürler.
Sub al()
Application.Calculation = xlCalculationManual
Dim sh As Worksheet
Dim satir As String
Set sh = Sheets("SINAV")
Dim deger1, deger2 As String
'On Error resume next
Application.ScreenUpdating = False
sn = sh.Cells(65536, 1).End(xlUp).Row
sayi1 = sh.Cells(1, "a")
sayi2 = sh.Cells(1, "b")
st = 3
Dim FSO As Object
Dim Kaynak As String
dosya = Application.GetOpenFilename("Metin dosyası (*.txt),*.txt", , "Hedef Dosyayı Seçin")
If dosya = False Then Exit Sub
sh.Range("a5:b" & sn + 1).ClearContents
Open dosya For Input Access Read As #1
While Not EOF(1)
bas = 1
Line Input #1, satir
For i = 1 To 4
sayi1 = sh.Cells(1, i)
deger1 = Mid(satir, bas, sayi1)
sh.Cells(st, i).Style.NumberFormat = "@"
sh.Cells(st, i) = deger1
bas = bas + sayi1
Next i
st = st + 1
Wend
Close #1
Application.ScreenUpdating = True
Set sh = Nothing
Application.Calculation = xlCalculationAutomatic
End Sub
Aşağıdaki kodda:
deger1 = Mid(satir, bas, sayi1)
kısmında Run-time error'13':
Type mismatch hatası almaktayım.
Yardımcı olursanız sevinirim.Teşekkürler.
Sub al()
Application.Calculation = xlCalculationManual
Dim sh As Worksheet
Dim satir As String
Set sh = Sheets("SINAV")
Dim deger1, deger2 As String
'On Error resume next
Application.ScreenUpdating = False
sn = sh.Cells(65536, 1).End(xlUp).Row
sayi1 = sh.Cells(1, "a")
sayi2 = sh.Cells(1, "b")
st = 3
Dim FSO As Object
Dim Kaynak As String
dosya = Application.GetOpenFilename("Metin dosyası (*.txt),*.txt", , "Hedef Dosyayı Seçin")
If dosya = False Then Exit Sub
sh.Range("a5:b" & sn + 1).ClearContents
Open dosya For Input Access Read As #1
While Not EOF(1)
bas = 1
Line Input #1, satir
For i = 1 To 4
sayi1 = sh.Cells(1, i)
deger1 = Mid(satir, bas, sayi1)
sh.Cells(st, i).Style.NumberFormat = "@"
sh.Cells(st, i) = deger1
bas = bas + sayi1
Next i
st = st + 1
Wend
Close #1
Application.ScreenUpdating = True
Set sh = Nothing
Application.Calculation = xlCalculationAutomatic
End Sub
