Back to Browse

🔥Excel Automation with Python | Split Data into Multiple Sheets in Seconds. #Excel #VBA and #SQL

62 views
Apr 29, 2026
22:41

Welcome to ExcelVBA Expert, your go-to channel for mastering a range of technologies, including Excel, VBA, SQL, Power BI, Microsoft Forms, Google Forms, Power Apps, Power Automate, SharePoint List, Power Query, Power Pivot, and Python. Dive into our video tutorials where we explore Data Analytics, unraveling the intricacies of extracting valuable insights from raw data using various technologies. Whether you are a beginner or an experienced professional, our content caters to all skill levels. Join our vibrant community of ExcelVBA experts by hitting that subscribe button. Your journey to becoming proficient in diverse technologies begins here. Thanks for dropping by! To stay connected, feel free to join our WhatsApp group through the link below: WhatsApp Link: https://www.youtube.com/redirect?even... For any inquiries or collaboration, reach out to us at [email protected]. Explore our Playlists: VBA Playlist: • Read the outlook Mails from Desktop folder... Excel Playlist: • 5 Pivot Table Tips & Tricks. SQL Playlist: • Connectivity of SQL & Excel using VBA MIS Test Paper Playlist: • MIS Test Paper -2 in Hindi #Excelvba exper... Embark on your learning journey with ExcelVBA Expert—where technology meets expertise! Whatsupp Group : https://chat.whatsapp.com/Gxkk9F2gWx56hcCN2f6IbC Python code- '-------- import pandas as pd import os from openpyxl import load_workbook file=os.path.join(os.path.expanduser("~"),"desktop") #--'We are getting dynamic path option=input("PLease confirm whether you want to split your data in Eixsting workbook if in Existing workbook please writer yes and else no") if option=="yes": filepath=input("please enter the filepath from which you want to consolidate your data...") dt=pd.read_excel(filepath) with pd.ExcelWriter(filepath,engine="openpyxl",mode="a") as writer: for x in dt['Country'].unique(): dt1=pd.DataFrame() dt1=dt[dt['Country']==x] dt1.to_excel(writer,sheet_name=x,index=False) print('Done') else: filepath=input("please enter the filepath from which you want to consolidate your data...") dt1=pd.DataFrame() dt1.to_excel(file+'\mydata.xlsx') dt=pd.read_excel(filepath) filepath1=os.path.join(file,'mydata.xlsx') with pd.ExcelWriter(filepath1) as writer: for x in dt['Country'].unique(): dt2=pd.DataFrame() dt2=dt[dt['Country']==x] dt2.to_excel(writer,sheet_name=x,index=False) print("Data has been saved") ---

Download

0 formats

No download links available.

🔥Excel Automation with Python | Split Data into Multiple Sheets in Seconds. #Excel #VBA and #SQL | NatokHD