Hi all,
I recorded and tweaked the below macro to process a .csv file which is named as " 2000-06-14_BSECM ". I have about 5000 .csv files to process the same thing.
I kindly request any one to help me looping the below code so that i could avoid the Hercules task of processing each .csv file.
Except the Date of the .csv the rest of the .csv name remains constant.
Is it possible to have a calender in excel sheet so that i can choose the dates to process the .csv files.
I would also like to know whether this code can be further tweaked so that the loop runs faster.
Thank you
I recorded and tweaked the below macro to process a .csv file which is named as " 2000-06-14_BSECM ". I have about 5000 .csv files to process the same thing.
I kindly request any one to help me looping the below code so that i could avoid the Hercules task of processing each .csv file.
Except the Date of the .csv the rest of the .csv name remains constant.
Is it possible to have a calender in excel sheet so that i can choose the dates to process the .csv files.
I would also like to know whether this code can be further tweaked so that the loop runs faster.
HTML:
Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+a
'
ChDir "C:\Users\pc\Desktop\BSE"
Workbooks.Open Filename:="C:\Users\pc\Desktop\BSE\2010-06-14_BSECM.csv"
Columns("B:B").Insert Shift:=xlToRight
Columns("A:A").TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="-", FieldInfo:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
Columns("B:B").Delete Shift:=xlToLeft
ActiveWorkbook.SaveAs Filename:= _
"C:\Users\pc\Desktop\BSE\2010-06-14_BSECM.csv", FileFormat:=xlCSV, _
CreateBackup:=False
ActiveWindow.Close
End Sub
Thank you