Skip to content
Advertisement

Export sheets from excel with given names and save them to new excel files

Is it possible to export multiple excel sheets having the same naming attribute to new excel file ? For example I have excel file named ONTO.xlsx and this file has 4 sheets:

  1. Classification
  2. ClassificationTypeAllowed
  3. BizHierarchy
  4. BizHierarchyType

I want to export from ONTO.xlsx every sheet with Classification in its name to Class.xlsx and every sheet with Biz in its name to Biz.xlsx
Is it possible with openpyxl ? Any help would be greatly appreciated!

Advertisement

Answer

Ok. I think It’s not possible to just concatenate other excel files into one excel file using openpyxl. My only solution for this is to delete unused sheets and then save this as the new Excel file.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement