Ya he conseguido hacer una parte pero al momento de crearlos me dice que el archivo ya existe, este es mi código hasta ahora..
Dim contadoo As Long
contadoo = 0
Dim filasss As String
Dim productosss As String
Dim divisa4
Open Ubica & "CONTRAT.txt" For Input As #1
Open Ubica & "TRANSAC\transaccion.txt" For Append As #2
While Not EOF(1)
Line Input #1, filasss
While ((Mid(filasss, 66, 32)) <> "122 REVERSO ENTERAR REMUNERACION")
Line Input #1, filasss
Print #2, Mid(filasss, 1, 180)
If IsNumeric(Mid(filasss, 20, 1)) = -1 Then
productosss = Trim(Mid(filasss, 19, 8))
End If
If (Mid(filasss, 66, 32)) = "122 REVERSO ENTERAR REMUNERACION" Then
Close #2
Name Ubica & "TRANSAC\transaccion.txt" As Ubica & "TRANSAC\transaccion_" & productosss & ".txt"
'Kill Ubica & "transaccion.txt"
Open Ubica & "TRANSAC\transaccion.txt" For Append As #2
End If
Wend
contad = contad + 1
Wend
Close #1
Close #2
Kill Ubica & "Fondo\FondoP.txt"Dim contadoo As Long
contadoo = 0
Dim filasss As String
Dim productosss As String
Dim divisa4
Open Ubica & "CONTRATO.txt" For Input As #1
Open Ubica & "TRANSAC\transaccion.txt" For Append As #2
While Not EOF(1)
Line Input #1, filasss
While ((Mid(filasss, 66, 32)) <> "122 REVERSO ENTERAR REMUNERACION")
Line Input #1, filasss
Print #2, Mid(filasss, 1, 180)
If IsNumeric(Mid(filasss, 20, 1)) = -1 Then
productosss = Trim(Mid(filasss, 19, 8))
End If
If (Mid(filasss, 66, 32)) = "122 REVERSO ENTERAR REMUNERACION" Then
Close #2
Name Ubica & "TRANSAC\transaccion.txt" As Ubica & "TRANSAC\transaccion_" & productosss & ".txt"
'Kill Ubica & "transaccion.txt"
Open Ubica & "TRANSAC\transaccion.txt" For Append As #2
End If
Wend
contad = contad + 1
Wend
Close #1
Close #2
Kill Ubica & "Fondo\FondoP.txt"