Question

copy excel file

  • 14 September 2023
  • 1 reply
  • 22 views

Badge +3

Hello, I am copying information from some Excel files to another one. How do I make sure that this new Excel file contains the headers from the others?


1 reply

Userlevel 3
Badge +9

Hi @luis.espeleta,

 

Here is a simple way of copying a table from one Excel file to a new Excel file while preserving the headers:

 

Code:

 

Original workbook:

Original table in original workbook


New workbook:

New table in new workbook

This is the easiest way of copying a table over to a new workbook that I can think of.

 

You could also do this another way. If you open an Excel file and deselect “Sheet contains a header”, you can then loop “For each row in worksheet” and copy the table line by line to the new excel workbook. This will grab the header row as well because you unchecked “Sheet contains a header” so the row will be treated as any other row.

 

Please let me know if this helps you.

 

Thanks,

Logan P.

 

Reply