Professional Documents
Culture Documents
Function ArrayCount(InputArray)
'This function counts NOT the number of
'non-blank values in the array, but the
'number of available slots for values,
'whether the slots contain anything or not.
'It's similar to the Count Property (e.g.,
'Range("a1:c3").Count).
Function ArrayTranspose(InputArray)
'This function returns the transpose of
'the input array or range; it is designed
'to avoid the limitation on the number of
'array elements that the worksheet TRANSPOSE
'Function has.
Function ReplaceCorner( _
ByRef a As Variant, _
ByVal b As Variant) As Boolean
'This function replaces the section of _a_ with _b_ so that the
'bottom-right entry of b is the bottom-right entry of _a_.
'Currently _a_ must be a 2-D nonhierarchical array; _b_ can be
'anything no larger than _a_.
'If successful, returns True and _a_ is modified as a side-efect;
'otherwise, returns False and _a_ is left unmodified. Based
'substantially on a function written by Harlan Grove.
Function ReplaceSubArray( _
ByRef a As Variant, _
ByVal b As Variant, iRow As Variant, iCol As Variant) As Boolean
'This function replaces a section of array _a_, commencing with
'the element at a(iRow, iCol), with the elements of _b_.
'Currently _a_ must be a 2-D nonhierarchical array; _b_ can be
'(almost) anything no larger than the portion of a to the right
'and down from a(iRow, iCol). If successful, returns True and
' _a_ is modified as a side-efect; otherwise, returns False and
' _a_ is left unmodified. Inspired by a ReplaceCorner function
'written by Harlan Grove.
Function ArrayDimensions(InputArray)
'This function returns the number of dimensions
'of the input array
Function ConvertBase(InputArray, ResultingBase)
'This function converts an input array to
'a 0-based array or a 1-based array, in
'accordance with the ResultingBase argument
'(either 0 or 1). It accepts arrays with a
'base equal to the number of the ResultingBase
'argument, simply leaving them as is.
Function ArrayUniques(inputArray, _
Optional MatchCase As Boolean = True, _
Optional Base_Orient As String = "1vert", _
Optional OmitBlanks As Boolean = True)
'THIS PROCEDURE REQUIRES A PROJECT REFERENCE
'TO "MICROSOFT SCRIPTING RUNTIME".
'The function returns an array of unique
'values from an array or range. By default
'it returns a 1-based vertical array; for
'other results enter "0horiz", "1horiz" (for
'0-based or 1-based 1-D output) or
'"0vert" for 0-based vertical output) as the
'third argument. By default, the function is
'case-sensitive; i.e., e.g., "red" and "Red"
'are treated as two separate unique values;
'to avoid case-sensitivity, enter False as
'the second argument.
Function ArrayAlternates(InputArray, _
'Optional Odds As Boolean = True,
'Optional RowOrientation As Boolean = True)
'This function returns every odd or even row or
'column, depending on the input arguments. For every
'odd row, the second argument is True (or omitted);
'for every even row, the second argument is False;
'for every odd column, the second argument is True
'(or omitted) and the third is False; for every even column,
'the second argument is False and the third is False.
Function OneD(inputArray)
'This function changes a 2-D single row array to 1-D
'without the limitations of the built-in TRANSPOSE
'and INDEX functions; i.e., without the limit on array
'elements and without changing the type of the array
Function ThreeD(inputArray)
'This function changes a 1-D or 2-D array to
'a 3-D array (or leaves a 3-D array as is).
Function FourD(inputArray)
'This function changes a 1-D or 2-D or 3-D array
'(or a range) to a 4-D array (or leaves a
'4-D array as is).
Sub Deposit3DArray(inputArray)
'This procedure puts the values from
'a 3-D array onto a worksheet. Visualizing
'the 3-D array as a rectangular solid
'sitting on the xy-plane (analogous to the
'rows and columns plane of a worksheet),
'beginning at Cell B2 are deposited the
'contents of the two-D arrays in the xy-plane
'and the parallel planes at each level of the
'third dimension.