Wise Owl Answers - How do I loop through sheets in multiple closed Excel files?
Check out our other answers here https://youtube.com/playlist?list=PLNIs-AWhQzcluqE43JKakRKslaYwCouJu
Get files here https://www.wiseowl.co.uk/vba-macros/videos/vba-ado-net-recordsets/loop-worksheets-multiple-closed-workbooks/
If you'd like to help fund Wise Owl's conversion of tea and biscuits into quality training videos, you can click this link https://www.wiseowl.co.uk/donate?t=1 to make a donation. Thanks for watching!
Looping through the collection of worksheets in a workbook is a standard technique in Excel VBA and easy to accomplish when the workbook is open. Did you know that you can do the same thing when the workbook is closed? This video explains how to do this using the ActiveX Data Objects library. You'll learn how to loop through the Excel files in a folder, creating a connection to each file using an ActiveX Data Objects Connection object. You'll learn how to query the schema of each workbook to return a list of the worksheets and loop through this list to read the name of each sheet. You'll also learn how to create a recordset object and populate it with data using an SQL Select statement. As a bonus you'll learn about the SQL Union All statment to select data from multiple tables at the same time and how to add criteria to a query using the Where clause.
Chapters
00:00 The Question
01:30 Looping Through Excel Files in a Folder
03:55 Connecting to Each Workbook
09:54 Getting a List of Worksheets
12:28 Returning Column Names from a Recordset
14:45 Getting Rows from a Recordset
18:13 Looping Through an Array
21:05 Constructing an SQL Query
26:52 Selecting Data into a Recordset
29:16 Writing Recordset Data into a Worksheet
33:15 Adding Criteria to the Query
Visit www.wiseowl.co.uk for more online training resources in Microsoft Excel, Power BI, DAX, SQL Server, Reporting Services, Analysis Services, Integration Services, ASP.NET, C#, Visual Basic, Microsoft Access and more
Видео Wise Owl Answers - How do I loop through sheets in multiple closed Excel files? канала WiseOwlTutorials
Get files here https://www.wiseowl.co.uk/vba-macros/videos/vba-ado-net-recordsets/loop-worksheets-multiple-closed-workbooks/
If you'd like to help fund Wise Owl's conversion of tea and biscuits into quality training videos, you can click this link https://www.wiseowl.co.uk/donate?t=1 to make a donation. Thanks for watching!
Looping through the collection of worksheets in a workbook is a standard technique in Excel VBA and easy to accomplish when the workbook is open. Did you know that you can do the same thing when the workbook is closed? This video explains how to do this using the ActiveX Data Objects library. You'll learn how to loop through the Excel files in a folder, creating a connection to each file using an ActiveX Data Objects Connection object. You'll learn how to query the schema of each workbook to return a list of the worksheets and loop through this list to read the name of each sheet. You'll also learn how to create a recordset object and populate it with data using an SQL Select statement. As a bonus you'll learn about the SQL Union All statment to select data from multiple tables at the same time and how to add criteria to a query using the Where clause.
Chapters
00:00 The Question
01:30 Looping Through Excel Files in a Folder
03:55 Connecting to Each Workbook
09:54 Getting a List of Worksheets
12:28 Returning Column Names from a Recordset
14:45 Getting Rows from a Recordset
18:13 Looping Through an Array
21:05 Constructing an SQL Query
26:52 Selecting Data into a Recordset
29:16 Writing Recordset Data into a Worksheet
33:15 Adding Criteria to the Query
Visit www.wiseowl.co.uk for more online training resources in Microsoft Excel, Power BI, DAX, SQL Server, Reporting Services, Analysis Services, Integration Services, ASP.NET, C#, Visual Basic, Microsoft Access and more
Видео Wise Owl Answers - How do I loop through sheets in multiple closed Excel files? канала WiseOwlTutorials
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
Wise Owl Answers - How do I get data from a closed Excel file using VBA?How to Loop through Sheets in a Workbook in Excel VBA (Macros) - Code IncludedSSIS Tutorials - 2.Load Multiple Excel Files in SSISExcel VBA Introduction Part 15 - Do Until and Do While LoopsExcel VBA For Loop Data MatchingVBA: Split data into Separate WorkbooksExcel VBA Introduction Part 29.1 - Creating Outlook EmailsAdvanced RANKX - How To Understand This Function More DeeplyHow to use ADO and VBA to Read from a DatabaseWise Owl Answers - How do I get data from multiple closed Excel files using VBA?Wise Owl Answers - How do I copy sheets from multiple Excel files into one worksheet?Wise Owl Answers - How do I resize a Word table after copying from Excel?How to Connect an Excel Workbook to Another Workbook in Excel 2019Wise Owl Answers - How do I populate an array with an ADODB recordset?Wise Owl Answers - How do I loop through worksheets in a closed workbook?Wise Owl Answers - How do I copy data without using copy and paste in Excel VBA?Wise Owl Answers - How do I loop through folders and subfolders in Excel VBA?Excel VBA Online Course - 3.3.1 The Select Case StatementPower BI Calculate with ALL to ignore the filter context- 18 (Power BI Training)