Yes
Worksheet. A Worksheet object can be accessed from the Sheets or the Worksheets object by using a Sheet or Worksheet index number or a Sheet or Worksheet name (e.g. Sheets(1), Worksheets(1), Sheets(Sheet1) or Worksheets(Wksheet1)). You can also use 'ActiveSheet' to access the current active Sheet. A Workbook object can be accessed from the Workbooks Collection by using a Workbook index number or a Workbook name (e.g. Workbooks(1) or Workbooks(Book1)). You can also use 'ActiveWorkbook' to access the current active Workbook. From the Worksheet object, you can access the Rows and Columns objects, which are collections of Range objects relating to the Rows and Columns of the Worksheet. You can also access an individual cell or any Range of contiguous cells on the Worksheet. Rows. The Rows object is a collection of all the Rows of a Worksheet. A Workbook object can be accessed from the Workbooks Collection by using a Workbook index number or a Workbook name (e.g. Workbooks(1) or Workbooks(Book1)). You can also use 'ActiveWorkbook' to access the current active Workbook. You also have a number of worksheet reports that have lists of student IDs. For each of these worksheets you need to print the mark for each student. You could do this by adding the 10,000 students to a collection using their student id as they key. 1 The items do not have to be of the same type but they normally are. 2  The VBA Sheets collection can contain both worksheets and chart sheets. 3  A collection makes it easy to perform the same task on multiple items e.g. print all the values. Collection of objects using Excel VBA. Collection provides a convenient way to refer to a group of objects and collections as a single object. The objects and collections in the collection don't have to be of the same data type. In the following example we will use collections for a class (that is a collection of objects of type Vendor). If numeric, after must be a number from 1 to the value of the collection's Count property. If a string, after must correspond to the key specified when the member referred to was added to the collection. You can specify a before position or an after position, but not both. When you add a new item VBA automatically sets the Collection variable to a valid collection. In other words if you set the collection to nothing it will empty all the items. If you then add an item to the collection you will now have a collection with one item. 1 The items do not have to be of the same type but they normally are. 2  The VBA Sheets collection can contain both worksheets and chart sheets. 3  A collection makes it easy to perform the same task on multiple items e.g. print all the values. VBA creates a single variable with 20 different slots into which you can add data (such as employee names). Such an array variable is akin to an Excel range that consists of 20 cells in a row or column: the range is a single entity, but it contains 20 slots (cells) into which you can insert data. The major difference is that you almost always use an array variable to hold data of a single type, such as. . The most common ones are the Workbooks, Worksheets, Range and Cells collections. The following code shows some examples of using the VBA Workbooks collection. A Quick Guide to collections. Collections are similar to arrays so it is important to understand what they are and how the differ to arrays. 1 The items do not have to be of the same type but they normally are. 2  The VBA Sheets collection can contain both worksheets and chart sheets. 3  A collection makes it easy to perform the same task on multiple items e.g. print all the values. To use a built-in collection, you can declare a variable for it. Here is an example: In reality, and as we will next in the next lessons, when Microsoft Excel starts, most (if not all) of the built-in collection classes are already available so that you do not have to declare their variable before using them. A collection is a series of items where each item has the same characteristics. In other words, all items can be described the same way. Programmatically, a collection is a series of items where all items share the same properties and methods, if any. 1 VBA has its own collections such as Workbooks, Worksheets and Cells. 2  The items do not have to be of the same type but they normally are. 3  The VBA Sheets collection can contain both worksheets and chart sheets. 4  A collection makes it easy to perform the same task on multiple items e.g. print all the values. 1 The items do not have to be of the same type but they normally are. 2  The VBA Sheets collection can contain both worksheets and chart sheets. 3
http://www.excelfunctions.net/Excel-Objects.html http://www.excelfunctions.net/Excel-Objects.html http://excelmacromastery.com/Blog/index.php/the-complete-guide-to-collections-in-excel-vba/ http://vbadud.blogspot.com/2008/11/how-to-use-collections-in-excel-vba.html http://excelmacromastery.com/Blog/index.php/the-complete-guide-to-collections-in-excel-vba/ http://www.quepublishing.com/articles/article.aspx?p=712186&seqNum=4 http://excelmacromastery.com/Blog/index.php/the-complete-guide-to-collections-in-excel-vba/ http://www.functionx.com/vbaexcel/objects/Lesson6.htm http://excelmacromastery.com/Blog/index.php/the-complete-guide-to-collections-in-excel-vba/
can you have a number as the ID in a vba collection