Skip to content

A List object for VBA that adds some syntactic sugar and some features you'd expect of a List in modern languages.

License

Notifications You must be signed in to change notification settings

SSlinky/VBA-List

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 

Repository files navigation

VBA-List

List object that extends a Collection

MIT license VBA Buy me a Beer!

List exposes the standard functionality of a Collection object as well as providing additional useful functionality that avoids boilerplate.

  • Push and Pop in Stack or Queue mode.
  • IndexOf method to search list.
  • Reference objects by negative index gets from end.
  • Slice list by range of indices.
  • Filter list by predicate.
  • Sort list.

Installation

Download the List.cls file and add it to your project.

Note: This class depends on a reference to OLE Automation, however, this is referenced by default for new workbooks.

Licence

Released under MIT by Sam Vanderslink. Free to modify and reuse.

Documentation

Read the docs for usage and examples.

Test Results

   Pass: TestList_ItemPositiveIndexReturnsItem
   Pass: TestList_ItemNegativeIndexReturnsItem
   Pass: TestList_ItemsAsObjectsReturned
   Pass: TestList_InsertInsertsAtZero
   Pass: TestList_InsertInsertsMid
   Pass: TestList_RemoveRemovesItem
   Pass: TestList_IndexOfReturnsValueIndex
   Pass: TestList_IndexOfDoesntFindValueIndex
   Pass: TestList_IndexOfDoesntFindValueNoItems
   Pass: TestList_IndexOfReturnsObjectIndex
   Pass: TestList_PushAddsItem
   Pass: TestList_PopGetsAndRemovesFromQueue
   Pass: TestList_PopGetsAndRemovesFromStack
   Pass: TestList_ItemGetsItemsSlice
   Pass: TestList_FilterFiltersStrings
   Pass: TestList_FilterFiltersNumbers
   Pass: TestList_SortListSortsStrings
   Pass: TestList_SortListSortsNumbers
   Pass: TestList_ForEachLoop
-------------------------------------------
   Passed: 19 (100.00%)
   Failed: 0 (0.00%)
-------------------------------------------

About

A List object for VBA that adds some syntactic sugar and some features you'd expect of a List in modern languages.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages