Sub convertidor_txt()
Dim ruta As String
ruta = "C:\Users\jesus santrich\Documents\Documentos escritorio\pruebas\04-Jun.txt"
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
Open ruta For Output As #1
For i = 1 To lastrow
Print #1, Cells(i + 1, 1).Value
Next i
Close #1
End Sub
ruta = "C:\Users\jesus santrich\Documents\Documentos escritorio\pruebas\"& range("A2").value
Sub convertidor_txt()
Dim Fila As Long, Colu As Long, Ruta As String, File As String
Const Text_1 = "¿Quiere Guardar el fichero: "
Const Text_2 = vbYesNo + vbQuestion
Const Text_3 = "GUARDAR"
Fila = ActiveCell.Row
Colu = ActiveCell.Column
Ruta = "C:\Users\jesus santrich\Documents\Documentos escritorio\pruebas\"
If Fila = 1 Then
If Not Cells(Fila, Colu) = Empty Then
File = Format(Cells(1, 3), "dd-mmm") + ".txt"
If MsgBox(Text_1 & File, Text_2, Text_3) = vbYes Then
Ruta = Ruta + File
Open Ruta For Output As #1
Fila = 2
While Cells(Fila, Colu) <> Empty
Print #1, Cells(Fila, Colu).Value
Wend
Close #1
MsgBox "Fichero guardado.", vbInformation + vbOKOnly, "Fin Macro"
End If
End If
End If
End Sub
Sub convertidor_txt()
Dim Fila As Long, Colu As Long, Ruta As String, File As String
Const Text_1 = "¿Quiere Guardar el fichero: "
Const Text_2 = vbYesNo + vbQuestion
Const Text_3 = "GUARDAR"
Fila = 1
Colu = ActiveCell.Column
Ruta = "C:\Users\jesus santrich\Documents\Documentos escritorio\pruebas\"
If Not Cells(Fila, Colu) = Empty Then
File = Format(Cells(1, 3), "dd-mmm") + ".txt"
If MsgBox(Text_1 & File, Text_2, Text_3) = vbYes Then
Ruta = Ruta + File
Open Ruta For Output As #1
Fila = 2
While Cells(Fila, Colu) <> Empty
Print #1, Cells(Fila, Colu).Value
Wend
Close #1
MsgBox "Fichero guardado.", vbInformation + vbOKOnly, "Fin Macro"
End If
End If
End Sub
Sub convertidor_txt()
Dim Fila As Long, Colu As Long, Ruta As String, File As String
Const Text_1 = "¿Quiere Guardar el fichero: "
Const Text_2 = vbYesNo + vbQuestion
Const Text_3 = "GUARDAR"
Fila = 1
Colu = ActiveCell.Column
Ruta = "C:\Users\Usuario\Desktop\pruebas\"
If Not Cells(Fila, Colu) = Empty Then
File = Format(Cells(1, Colu), "dd-mmm") + ".txt"
If MsgBox(Text_1 & File, Text_2, Text_3) = vbYes Then
lastrow = Cells(Rows.Count, Colu).End(xlUp).Row
Ruta = Ruta + File
Open Ruta For Output As #1
For i = 1 To lastrow
Print #1, Cells(i + 1, Colu).Value
Next i
Close #1
MsgBox "Fichero guardado.", vbInformation + vbOKOnly, "Fin Macro"
End If
End If
End Sub