VBA Advanced Lesson 4 Introduction To Collections
VBA Advanced Lesson 4 Introduction To Collections
In This Section:
Introduction to Collections?
Collection is an object contains group of objects having similar characteristics (with same
properties and methods). For example,if you want to loop through all worksheets in a
workbook, you can refer worksheets collection of the workbook and do whatever you want
Below are the most frequently used Collections in the Excel VBA:
Collections Use
AddIns Collection We can loop through the installed and available add-in in your
Excel. You can use it for finding all available add-ins
Names Collection We can loop through All names and change the properties
We can loop through the all pivot caches in the workbook and
PivotCaches Collection
change the properties
We can loop through all the pivot tables and change the
PivotTables Collection
formats and other properties
Example 2: This code will loop through the Chart objects in a Worksheet and display the names
of the Chart Objects