Python Program to combine data from different Worksheets of an Excel Workbook is explained in this video.

1. Intro (0:00)
2. Download and Install Python (0:56)
3. Install pandas and tkinter (1:40)
3. Writing the code (2:09)
4. Explanation of the code (7:44)
5. Graphical User Interface for selecting the Excel file (9:28)
6. Demo of Excel Macro for combining data from multiple Worksheets (12:52)

Check these Python Tutorials too.
Python Program to Add Text and Insert Formulas in Multiple Excel Files.
https://youtu.be/FOu7_5QqY0c
Python Program to read multiple Excel Workbooks.
https://youtu.be/M7YkQpcB4fg
Combine data from different Worksheets of an Excel Workbook using Power Query
https://youtu.be/z-QwyRdOGqQ

Code
import pandas as AJ
from tkinter import *
from tkinter import filedialog
import os
filepath = ""
def openFile():
global filepath
filepath = filedialog.askopenfilename()
print(filepath)
window.destroy()
window = Tk()
button = Button(text="Select Excel File", command=openFile)
button.pack()
window.mainloop()
if filepath:
AJxls = AJ.ExcelFile(filepath)
AJdataframes = []
for sheet_name in AJxls.sheet_names:
df = AJ.read_excel(filepath, sheet_name=sheet_name)
AJdataframes.append(df)
combined_data = AJ.concat(AJdataframes, ignore_index=True)
directory_path = os.path.dirname(filepath)
combined_file_path = os.path.join(directory_path, 'Data_Combined_GUI.xlsx')
combined_data.to_excel(combined_file_path, index=False)
print("Data from all Sheets combined and saved to", combined_file_path)
else:
print("No file selected")

Top 25 Microsoft Word Tips and Tricks - https://youtu.be/l25Evu4ohKg
7 Most Important Tools in Excel - https://youtu.be/Pc88LGWNO70
Download my free eBook on Excel Macros - http://eepurl.com/gpT0RD
Check these Books on Excel - https://xlncad.com/excel-resources/
Read my articles on Excel - https://xlncad.com/

If you’ve found my videos helpful or enjoyable, consider supporting me with a coffee!
buymeacoffee.com/ajayanand

Subscribe to @XLnCADMalayalam for Excel, Word, PowerPoint, Access, Python and Power BI Tutorials in Malayalam.
https://www.youtube.com/c/XLnCADMalayalam

Disclaimer: If you click on my affiliates links, I am going to receive a tiny commission. The products that I advertise are the ones I believe in.
My Running Kit for Hyderabad Marathon 2025
https://amzn.to/44IILeG
Think Like an Analyst: Books That Helped Me
https://amzn.to/3SNy6bi
Mind-Opening Reads You Can’t Miss
https://amzn.to/43tM2fu

#pythontutorial #pythonforexcel #pythontutorialforbeginners