Agregar Una Fecha A Un Documento De Texto
Dim LETRA As String
Dim LETRA1 As String
Dim TODO As String
Dim INICIO As String
Dim NUEVO As String
Dim FINAL As String
Range("A1").Select
I = 0
CELDA = 1
Do WhileActiveCell > 0
TODO = Cells(CELDA, 1)
LETRA = Mid(TODO, 21, 4)
'Range("F1") = LETRA
LETRA1 = Mid(TODO, 22, 4)
'Range("F1") = LETRA1
If LETRA = "4028" Then
AÑO = "2010"
INICIO =Mid(TODO, 1, 20)
FINAL = Mid(TODO, 21, 80)
NUEVO = "" & INICIO & "" & AÑO & "" & FINAL & ""
Cells(CELDA, 1) = NUEVO
End If
If LETRA1 = "4028" Then
AÑO ="2010"
INICIO = Mid(TODO, 1, 21)
FINAL = Mid(TODO, 22, 80)
NUEVO = "" & INICIO & "" & AÑO & "" & FINAL & ""
Cells(CELDA, 1) = NUEVO
End If
If LETRA1 ="1846" Then
AÑO = "2011"
INICIO = Mid(TODO, 1, 21)
FINAL = Mid(TODO, 22, 80)
NUEVO = "" & INICIO & "" & AÑO & "" & FINAL & ""
Cells(CELDA, 1) = NUEVOEnd If
CELDA = CELDA + 1
ActiveCell.Offset(1, 0).Select
Loop
Call GRABARCERRAR
End Sub
Sub CARGAARCHIVO()
'
' Macro5 Macro
Dim mes As String
Dim nom1 As String
Dim nomm AsString
Dim nom2 As String
Dim NOMBRE As String
mes = InputBox("Introduce el Mes.")
NOMBRE = "1TRM9304235G6" & mes & "2012"
'
With ActiveSheet.QueryTables.Add(Connection:= _"TEXT;C:\FOLIOS\1TRM9304235G6" & mes & "2012.txt", Destination:=Range( _
"$A$1"))
.Name = NOMBRE
.FieldNames = True
.RowNumbers = False.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 850
.TextFileStartRow = 1
.TextFileParseType =...
Regístrate para leer el documento completo.