Hello all,
I have no prior knowledge of VBA code, so please bear withme if this question has been answered before in some way or another.
The context of the problem is that I have a relativelylarge (>100) number of .csv files which all follow the same format and the samethree rows need to be removed from each in order for data processing on them toproceed. The row lines are 19, 21 and 23 – up til now I have been using a macroand obviously it is rather tedious, but doesn’t take too much time. However, Iwould like to speed it up even more.
I was hoping to adapt this code from another topic: https://www.mrexcel.com/forum/excel-questions/553423-how-delete-4-lines-each-workbook-specific-folder-vba-code-required.html
Except I would make these changes:
I have no prior knowledge of VBA code, so please bear withme if this question has been answered before in some way or another.
The context of the problem is that I have a relativelylarge (>100) number of .csv files which all follow the same format and the samethree rows need to be removed from each in order for data processing on them toproceed. The row lines are 19, 21 and 23 – up til now I have been using a macroand obviously it is rather tedious, but doesn’t take too much time. However, Iwould like to speed it up even more.
I was hoping to adapt this code from another topic: https://www.mrexcel.com/forum/excel-questions/553423-how-delete-4-lines-each-workbook-specific-folder-vba-code-required.html
Except I would make these changes:
- Alterthe preamble warning windows as these are .csv files, not .xls.
- ChangeDir(“.xls”) to Dir(“.csv”)
- Changethe rows in the parentheses to the correct coordinates, so WS.Rows(“1:4”)becomes WS.Rows(“19:19,21:21,23:23”).
However when I ran this code in the editor it onlyprocessed one file out of 128 in the directory which contained all of my rawdata – what it did was open and close every other file without changing them atall!
Can anyone help me with providing the corrected code formy purpose? Would also like to know where I went wrong.
Thanks in advance.