Author Topic: Moving Columns in Excel  (Read 671 times)


  • Newbie
  • *
  • Posts: 4
Moving Columns in Excel
« on: January 29, 2019, 08:10:17 am »

Anyone have any luck moving columns in Excel. I have been trying to rearrange the data in a worksheet before I export it but cannot seem to get a column to move via Cut or copy. Anyone have any snippets of code that will do the trick? Your help is much appreciated.


  • Tech Support
  • *****
  • Posts: 3739
    • WinBatch
Re: Moving Columns in Excel
« Reply #1 on: January 29, 2019, 09:18:52 am »
Assuming that you want to use WinBatch to perform the task, the general solution is to perform your task while recording a macro in Excel and then translating the macro to a WIL script.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade


  • Pundit
  • *****
  • Posts: 1441
Re: Moving Columns in Excel
« Reply #2 on: January 29, 2019, 11:18:48 am »
Moving columns can often be a bit messy. You did write that you intend to export the data. Maybe a little more detail on that, because you might consider using ADO and the ACE Provider to open the Excel data as a recordset then re-arrange the columns with SQL.