Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Guys, has anyone got a macro where I can import a text file saved on my computer into a new sheet named yesterdays or todays date in format "ddmmyy" and then the sheet gets hidden. Thanks in advance for your help Gunny -- gunny1979 ------------------------------------------------------------------------ gunny1979's Profile: http://www.excelforum.com/member.php...o&userid=32932 View this thread: http://www.excelforum.com/showthread...hreadid=545015 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Gunny,
use macro recorder. In case you will need to modify the recorded code, post it in the forum. Regards, Ivan |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Sub ImportData() ThisWorkbook.Sheets.Add after:=Sheets(Sheets.Count) ActiveSheet.Name = Format(Date, "ddmmyy") Workbooks.Open FileName:="C:\text.txt", Format:=2 Cells.Copy ThisWorkbook.Sheets(Format(Date, "ddmmyy")).[a1] Workbooks("text.txt").Close savechganges:=False Sheets(Format(Date, "ddmmyy")).Visible = False End Sub Change "C:\text.txt" to refer to your file. I've assumed that the file is comma-delimited. If it's not, change the "Format:=2" to whatever you need it to be (check Help for the Open method for the options). Col -- colofnature ------------------------------------------------------------------------ colofnature's Profile: http://www.excelforum.com/member.php...o&userid=34356 View this thread: http://www.excelforum.com/showthread...hreadid=545015 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Importing a text file | Excel Discussion (Misc queries) | |||
Importing CSV file (saved as Text) into XL as Text -- over 60 colu | Excel Discussion (Misc queries) | |||
Importing text file, only option to edit existing file | Excel Discussion (Misc queries) | |||
importing text file, removing data and outputting new text file | Excel Programming | |||
Importing Text File | Excel Programming |