The following topics will be covered:
- Transfer Data From One Sheet to another in Excel | Node.js library installation
- Excel transfer data from one sheet to another
- Copy data from one Workbook to another
Transfer Data From One Sheet to another in Excel | Node.js library installation
npm install java npm install aspose.cells
Excel transfer data from one sheet to another
Once the installation is done, we can transfer data from one Excel sheet to another programmatically.
You can follow the steps and the code snippet mentioned below:
- Instantiate an instance of the Workbook class and load the source XLSX/XLS file.
- Create a Worksheets object with reference to the sheets of the Workbook by calling the getWorksheets method.
- Invoke the addCopy method to copy data to a new sheet from an existing sheet within the Workbook.
- Save the Excel file by calling the save method.
Copy & paste the following code into your main file:
The output can be seen in the image below:
Copy data from one Workbook to another
These are the steps:
- Create an object of the Workbook class and load the source XLSX/XLS file.
- Create another Workbook object.
- Copy the first sheet of the first book into the second book by calling the copy(source) method.
- Invoke the save method to save the file.
You can see the output in the image below:
Get a Free License
You can avail a free temporary license to try the API without evaluation limitations.
Moreover, we suggest you follow our Getting Started guide.
Finally, conholdate.com is writing new blog posts. So, please stay in touch for regular updates.
Ask a question
You can let us know about your questions or queries on our forum.
How do I automatically transfer data from one Excel sheet to another?
Please follow this link to achieve data transfer among sheets programmatically.