Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.

XLS to CSV and Rename Columns Automatically

  • 23-01-2017 10:40PM
    #1
    Moderators, Sports Moderators, Regional Midwest Moderators Posts: 24,065
    Mod ✭✭✭✭


    Hi All,

    This has been wrecking my head, I thought I could do a little VB script but it's beyond me.

    I have an xls file (Extract.XLS) with 10 columns, (ID No.,First,Last,Addr1,Addr2,Town,County,Country,Phone,Email), I need to save the file as a CSV (simple enough Save As to Import.csv I hope) but I also need to move a couple of columns around and rename the headers (First,Surname,Payroll,Address1,Address2,City,County,Country,Phone,Email). I'd love to be able to have a way of automatically doing it but if that's not possible if there could be a nice easy way to do it without much manual intervention.


Comments

  • Registered Users, Registered Users 2 Posts: 382 garbeth
    ✭✭


    Will the Sb file always be in that format. Is yes then the excel file will always have the same columns in the same format. You can create a macro in excel that renames the columns to what you want them to be.

    If you have any coding experience the code behind the macro is pretty easy to rewrite if you want to add anything fancy in.

    The macro recorder basically just records what you are doing so it can be repeated when running the macro again.


  • Moderators, Sports Moderators, Regional Midwest Moderators Posts: 24,065 Clareman
    Mod ✭✭✭✭


    The file should always be in the same format so that's good to go, I never thought of the macro recorder option, I'll use that, thanks Garbeth.


Welcome!

It looks like you're new here. Sign in or register to get started.
Advertisement