View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
mudraker[_239_] mudraker[_239_] is offline
external usenet poster
 
Posts: 1
Default Macro to copy daily text file

Try this for starters

Note This does not test to see if sheet name already exists
You will also need to modify the
Workbooks.OpenText
statement to suit your needs


Dim wsNew As Worksheets
Set wsNew = Sheets.Add
wsNew.Name = "D" & Day(Now())

Workbooks.OpenText FileName:="D:\My Documents\Book2.txt", _
Origin:=xlWindows, StartRow:=1, DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, _
Space:=False, Other:=False, FieldInfo:=Array(1, 1)

ActiveWorkbook.Sheets(1).Cells.Copy Destination:=wsNew.Cells
ActiveWorkbook.Close savechanges:=Fals

--
Message posted from http://www.ExcelForum.com