I want to open and save multiple csv as excel file. Below is the macro that i found. but this macro only can use in my own computer as it is hard coded to "e:\new foler\" and "c:\testing2\". How can make mypath and mypath2 as variant with get application.foldername?
Code:
Sub TransformCSVToXls()
Application.DisplayAlerts = False
MyFile = ActiveWorkbook.Name
myPath = "[FONT=arial black]E:\New Folder\[/FONT]"
mypath2 = "[FONT=arial black][B]C:\Testing2\[/B][/FONT]"
WorkFile = Dir(myPath & "*.CSV")
Do While WorkFile <> ""
Application.StatusBar = "Now working on " & WorkFile
Workbooks.Open Filename:=myPath & WorkFile
ActiveWorkbook.SaveAs Filename:=mypath2 & _
Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4), FileFormat:=xlNormal
ActiveWorkbook.Close
Windows(MyFile).Activate
WorkFile = Dir()
Loop
Application.StatusBar = False
End Sub[CODE]