Hola Dante, como estas??
De antemano agradezco tu ayuda, siempre es muy util.
te cuento que hice las modificación de los nombres como me lo dijiste y adicional cambie hoja 8 por hoja 1. Y al ejecutar la macro paso paso trabaja muy bien para cargar el primer archivo pero me esta presentando un problema al momento de cargar el segundo archivo, cuando hace este paso borra toda la información la información, a continuación te presento los cambios y los pantallas de como queda.
Sub Abrir_Txts()
' Por Dante Amor
' Carga archivos de texto
'
Application.ScreenUpdating = False
Set h = Sheets("Hoja1")
h.Cells.Clear
'
ruta = ThisWorkbook.Path & "\"
arch1 = "Base Actual.txt" 'Poner los nombres de archivo
arch2 = "Base historica.txt"
u = 1
Call Carga_txt(h, ruta, arch1, u)
u = h.Range("A" & Rows.Count).End(xlUp).Row + 1
Call Carga_txt(h, ruta, arch2, u)
'
Application.ScreenUpdating = True
End Sub
'
Sub Carga_txt(h, ruta, arch, u)
With h.QueryTables.Add(Connection:= _
"TEXT;" & ruta & arch, Destination:=h.Range("A" & u))
.Name = "algo"
.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 = xlDelimited
.TextFileTextQualifier = xlTextQualifierNone
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileOtherDelimiter = "^"
.TextFileColumnDataTypes = Array(2)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub
Estos son los archivos .txt (los señalados)
al momento de cargar el Primer archivo
al momento de cargar el segundo archivo
no se que puede estar pasando, muchas gracias por toda tu ayuda