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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

XLS to CSV and Rename Columns Automatically

  • 23-01-2017 9:40pm
    #1
    Moderators, Sports Moderators, Regional Midwest Moderators Posts: 24,028 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: 379 ✭✭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,028 Mod ✭✭✭✭Clareman


    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.


Advertisement