I am trying to import a comma delimeted text. I have just tried to use the following macro code as posted on MrExcel web site. (http://www.mrexcel.com/tip025.shtml) However it just copies and pastes the data without putting the data in separate columns. However I want to put the data as delimited in separate columns.
Also I want to import not just one but several files at the same time.
Any suggestion, Please let me know.
--------------
VBA code as macro
Sub Autpen()
' This macro will put today's date as the default new tab name
Sheets("Menu").Select
Range("D5").Select
Selection.Formula = "=text(now(),""mmm dd yyyy"")"
Selection.Copy
Selection.PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
Selection.Columns.AutoFit
Range("D8").Value = ""
End Sub
Sub GetFile()
' This macro will import a file into this workbook
' Copyright 1999 http://www.MrExcel.com
Sheets("Menu").Select
PathName = Range("D3").Value
Filename = Range("D4").Value
TabName = Range("D5").Value
ControlFile = ActiveWorkbook.Name
Workbooks.Open Filename:=PathName & Filename
ActiveSheet.Name = TabName
Sheets(TabName).Copy After:=Workbooks(ControlFile).Sheets(1)
Windows(Filename).Activate
ActiveWorkbook.Close SaveChanges:=False
Windows(ControlFile).Activate
Sheets("Menu").Select
Range("D8").Select
ActiveCell.Value = "Completed"
Range("D9").Select
End Sub
Also I want to import not just one but several files at the same time.
Any suggestion, Please let me know.
--------------
VBA code as macro
Sub Autpen()
' This macro will put today's date as the default new tab name
Sheets("Menu").Select
Range("D5").Select
Selection.Formula = "=text(now(),""mmm dd yyyy"")"
Selection.Copy
Selection.PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
Selection.Columns.AutoFit
Range("D8").Value = ""
End Sub
Sub GetFile()
' This macro will import a file into this workbook
' Copyright 1999 http://www.MrExcel.com
Sheets("Menu").Select
PathName = Range("D3").Value
Filename = Range("D4").Value
TabName = Range("D5").Value
ControlFile = ActiveWorkbook.Name
Workbooks.Open Filename:=PathName & Filename
ActiveSheet.Name = TabName
Sheets(TabName).Copy After:=Workbooks(ControlFile).Sheets(1)
Windows(Filename).Activate
ActiveWorkbook.Close SaveChanges:=False
Windows(ControlFile).Activate
Sheets("Menu").Select
Range("D8").Select
ActiveCell.Value = "Completed"
Range("D9").Select
End Sub