Experimente assim então:
Sub Macro1()
'
' Macro1 Macro
'
strArquivo = Application.GetOpenFilename("Arquivos de texto (*.txt),*.txt") '
Workbooks.OpenText Filename:=strArquivo, Origin:= _
xlMSDOS, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1) _
, Array(10, 1), Array(21, 1), Array(53, 1), Array(61, 1), Array(71, 1), Array(89, 4), Array( _
106, 1), Array(126, 1)), TrailingMinusNumbers:=True
nWo = ActiveWorkbook.Name 'Nome do arquivo aberto
nSh = ActiveSheet.Name 'Nome da planilha no arquivo aberto
Range("A7:H7,A17:H17,A27:H27,A37:H37,A47:H47,A57:H57").Select
Range("A57").Activate
Application.CutCopyMode = False
Selection.Copy
Sheets.Add After:=Sheets(Sheets.Count)
Range("B1").Select
ActiveSheet.Paste
Sheets(nSh).Select
Range("H2,H12,H22,H32,H42,H52,H62").Select
Range("H62").Activate
Application.CutCopyMode = False
Selection.Copy
Sheets("Plan1").Select
Range("A1").Select
ActiveSheet.Paste
For x = 1 To 6
Cells(x, 1).Value = CDate(Format(Left(Cells(x, 1), 10), "dd/mm/yyyy"))
Next
'Selection.Replace What:=" hora:", Replacement:="", LookAt:=xlPart, _
' SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
' ReplaceFormat:=False
Sheets(nSh).Select
Range("A2,A12,A22,A32,A42,A52,A62").Select
Range("A62").Activate
Application.CutCopyMode = False
Selection.Copy
Sheets("Plan1").Select
Range("J1").Select
ActiveSheet.Paste
Range("H1:H7,A1:A7").Select
Range("A1").Activate
Application.CutCopyMode = False
Selection.NumberFormat = "dd/mm/yyyy"
Range("A1:J7").Select
Selection.Copy
Windows("ARV.xlsm").Activate
Sheets("Base").Select
Range("B4").Select
Selection.Insert Shift:=xlDown
Range("M1").Select
Application.CutCopyMode = False
End Sub
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 21/02/2014 8:30 am