API reference

Arrays

Transform, filter, sort, and group Variant arrays in memory.

17 public procedures5 enumerationsNew Arrays

Functions and procedures#

Inspection and values#

NameDescription
ExchangeSwap two Variant values in the caller through ByRef arguments.
DimCounterProbe array dimensions with UBound, up to the implementation's fixed limit of ten.

Selection and ordering#

NameDescription
SliceArrayExtract a row or column from a 2D array while keeping a 2D result.
SortStably sort a 1D array or the rows of a 2D array by one column.
FilterSelect rows using one or two criteria, combining them with AND or OR.
UniqueReturn distinct values from the first column in first-appearance order.

Array representations#

NameDescription
TransposeSwap the two dimensions of a 2D array using explicit VBA loops.
DimReduceConvert a single-row or single-column 2D array into a 1D array.
DimExpandConvert a 1D array into a 2D column array.
DimSplitConvert a 2D matrix into a 1D outer array containing one 1D array per row.
DimMergeConvert a 1D array of compatible 1D row arrays into a 2D matrix.
Change_LboundRebase one dimension of a 1D or 2D array without changing its values or shape.

Editing arrays#

NameDescription
InsertColumnsAppend columns to a 2D array or overwrite its trailing columns.
InsertLinesAppend rows or overwrite trailing rows, interpreting a 1D array as one row.
DeleteElementRemove one row or column from a 2D array and compact the remaining values.
FillColumnReplace an existing column with values from a positional column vector.

Aggregation#

NameDescription
GroupByGroup rows by one key column and compute one aggregate from another column.

Using this class#

The class has VB_PredeclaredId = False. Use an instance, or a shared instance declared in a standard module.

VBA
Dim utility As Arrays
Set utility = New Arrays
' Existing project global instance: Arr

Read the complete Arrays source