How to automatically merge a .xls file and a .csv file to one Excel sheet?

1

I have an Excel sheet in .xls file. I want to merge it with a .csv file, so that the data in the .csv file will be added starting from the first empty row in .xls.

I want to be able to do it automatically.

Igor Oks

Posted 2011-05-17T14:28:49.257

Reputation: 213

have you tried opening the csv in Excel , copying all the data and pasting it in the xls file ? – Shekhar – 2011-05-17T14:37:50.390

>

  • it's not a duplicate. the questions are related but different. 2. i want to be able to do it automatically, and not manually
  • < – Igor Oks – 2011-05-17T14:41:05.740

    Answers

    1

    You'll need to create a macro.

    The basic steps of the macro will be: 1) Open the xls file and find the last row with data. Add 1 to this and you get the first row without data. 2) Open the csv file, find the last row of data, and select and copy all the data rows. 3) Paste the data from the csv file into the xls file beginning with the first row without data.

    You can find the macro code for the individual steps of this process by Recording a macro for each of the different steps and then put the steps together to make it all work the way you need.

    In importing the CSV you'll want to make sure you have set each column to it's appropriate data type, otherwise, pasting into the xls may cause data corruption issues.

    music2myear

    Posted 2011-05-17T14:28:49.257

    Reputation: 34 957