I have an excel file that I need to convert into a CSV. This part is fine, I wrote this code to do so:
Private Sub createCSV()
Dim path As String
Dim ws As Excel.Worksheet
path = "\\networkshare\mydir"
For Each ws In Application.ActiveWorkbook.Worksheets
ActiveSheet.Range("1:2").EntireRow.Delete 'Delete the first two rows
ws.SaveAs path & ws.Name, xlCSV
Next
End Sub
However,
I need to only save specific columns to CSV in a certain order.
Column A,B of excel worksheet to Column D,E of CSV and Column C,D of worksheet as column A,B of CSV,etc
Is there a way to do this?
A,B} toEand then delete empty columns: {A,B} ;)