Copiar dados de arquivo TXT (a partir da 5ª linha)

DJVSWD

19-09-2014 15:52:39

Boa Tarde

Caros,

Gostaria de Saber é possível exportar dados de um arquivo txt para o excel, porém não quero que seja importado o "Cabeçalho" dentro desse arquivo.
Acredito que deveria contar as linhas desse arquivo txt para assim depois importar para o Excel porém não tenho idéia de como fazer isso.

Alguém pode me ajudar por favor!!!

Estou enviando o anexo de exemplo

Desde já agradeço!

Atenciosamente

Douglas

magushi

19-09-2014 17:53:36

DJ, boa tarde!

Veja se atende:

Sub import()

With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Users\"Coloque o caminho aqui", Destination:=Range("$A$1"))
.Name = "Base teste"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 932
.TextFileStartRow = 5
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
ActiveWindow.SmallScroll Down:=-15

End Sub

Espero ter ajudado!

Magushi

DJVSWD

19-09-2014 18:21:44

Magushi

Valeu deu certo muito obrigado!!

:)

magushi

19-09-2014 23:41:27

Precisando, estamos a disposição!

Abraço