Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
dear all
I try download file from spectroradiometer machine data is released in csv. format automatically in folder however, I want to arrange all data only in 1 worksheet can anyone help me how to use macro in excel to do that? need you sharing if ever done it? thanks evri |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Just opening the file in Excel should do what you want.
Sub Openfile() workbooks.Open "C:\Myfiles\"abc.csv" End sub If you mean you want to combine multiple files sub OpenMany() Dim bk as Workbook Dim bk1 as Workbook Dim rng as Range Dim cell as Range Dim bFirst as Boolean Dim fName as String fname = Dir("C:\Myfiles\*.csv") bFirst = True do while fname < "" set bk1 = Workbooks.Open( "C:\Myfiles\" & fName) set rng = bk.Worksheets(1).Usedrange if bFirst then bk.SaveAs "C:\XLS\MyData.xls" set bk1 = bk bFirst = False else set cell = bk1.Worksheets(1).Cells(rows.count,1).end(xlup)(2) rng.copy Destination:=cell bk.close SaveChanges:=False end if fName = Dir() Loop bk1.Save End Sub -- Regards, Tom Ogilvy "evri" wrote in message ... dear all I try download file from spectroradiometer machine data is released in csv. format automatically in folder however, I want to arrange all data only in 1 worksheet can anyone help me how to use macro in excel to do that? need you sharing if ever done it? thanks evri |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
in which folder can you save a .CSV file? | Excel Discussion (Misc queries) | |||
Need code to save file to new folder, erase from old folder | Excel Discussion (Misc queries) | |||
open file from folder save in new folder | Excel Programming | |||
Create Folder and Text File in folder | Excel Programming | |||
check if file is in particular folder | Excel Programming |