title: how change order of columns in csv file using VBA?
body: <p>I have 3 csv files which I have to merge and but before that I have to prepare then to have same columns order. All works fine except for I cannot figure out so far how change order of columns in output file. I can select columns which I want and other skips fine but what if I want to swap some? I thought that putting in proper order in fieldinfo array would do the trick but no. I want to swap 8 with 6.</p>
  
  <pre><code>    Application.ScreenUpdating = False
      Workbooks.OpenText Filename:=Filenamenew, Origin:=xlWindows, StartRow _
      :=2, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
      ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False, Comma:=True, _
      Space:=False, Other:=False, FieldInfo:=Array(Array(1, 3), Array(2, 9), Array(3, 1), Array(4, 9), Array(5, 9), Array(8, 1), Array(7, 9), Array(6, 1))
  
      Set Wb = ActiveWorkbook
      Application.DisplayAlerts = False
      Wb.SaveAs Filename:=LBname, FileFormat:=FileFormatNum, _
      ReadOnlyRecommended:=False, _
      CreateBackup:=False
      Application.DisplayAlerts = True
  
      Wb.Close savechanges:=False
  </code></pre>
  
  <p>thanks</p>