Notifications
Clear all

Macro - Importar Arquivo TXT para o Excel automaticamente

1 Posts
1 Usuários
0 Reactions
2,439 Visualizações
Eron
 Eron
(@eron)
Posts: 102
Illustrious Member Admin
Topic starter
 

Segue código pronto para importar Arquivo TXT para o Excel automaticamente

Autor: Noorain Ansari <[email protected]>

Sub convert_txtfile()
On Error GoTo abc
Dim txtifile
txtifile = Application.GetOpenFilename("TXT (*.TXT),*.TXT", , "Please select Text file...")
Workbooks.OpenText Filename:=txtifile, Origin:=xlWindows, StartRow:=1
With ActiveWorkbook
ActiveSheet.Move After:=.Worksheets(.Worksheets.Count)
End With
abc:
Exit Sub
End Sub

Eron
CRA/RS 27.563
Administrador Fórum Planilhando

 
Postado : 24/10/2011 8:35 pm