WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: dcrane37 on January 29, 2019, 08:10:17 AM

Title: Moving Columns in Excel
Post by: dcrane37 on January 29, 2019, 08:10:17 AM
Hello!

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.
Title: Re: Moving Columns in Excel
Post by: td 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.
Title: Re: Moving Columns in Excel
Post by: stanl 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.