I need a favor here i have a code that i need to transcript a txt file to excel without losing information and spliting it by a "-".
the vba is generating an error call 53 where it says that the file cant be found but thats the right direction of it
Sub inportartxt()
Dim i, j As Integer, fn As Integer, cadena As String, ruta As String, arr, arr2
fn = FreeFile
For k = 1 To 30
arr2 = "C:\Users\pipet\Desktop\Proyecto Sad\Proyecto 2\Demandas\demanda_1_06"
ruta = arr2
Open ruta For Input As #fn
Do While Not EOF(fn)
Line Input #fn, cadena
i = i + 1
arr = Split(cadena, "-")
For j = o To UBound(arr)
Sheets("Hoja1").Cells(i, j).Value = cadena
Next j
Loop
Next k
End Sub