Getting started

Installation

Add VBA-DataKit to an Excel macro-enabled workbook.

Download the VBA-DataKit ZIP archive, extract the VBA modules, then follow the setup instructions below.

Requirements#

Manual installation#

  1. Download and extract the VBA-DataKit ZIP. Locate the Arrays, Finance and Others .cls files.
  2. Open the destination workbook in Excel, press Alt + F11, then choose File → Import File… for each .cls module. Keep the exact class names.
  3. In the destination project, enable Microsoft Scripting Runtime using Tools → References.
  4. In a standard module, define the three shared instances shown below. Remove duplicate declarations if your workbook already has them.
  5. Run Debug → Compile VBAProject, then save the destination workbook as .xlsm.
VBA
Public Arr As New Arrays
Public Fin As New Finance
Public Others As New Others

Finance uses the global Arr object internally for array-shape utilities. If you import Finance, include Arrays and the Arr declaration above.

Quick usage example#

VBA
Sub Example()
    Dim data As Variant
    Dim result As Variant

    data = ThisWorkbook.Worksheets(1).Range("A2:C100").Value2
    result = Arr.Sort(data, 2, 1)

    If IsArray(result) Then
        ThisWorkbook.Worksheets(1).Range("E2").Resize(UBound(result, 1), UBound(result, 2)).Value2 = result
    End If
End Sub

The example assumes the input is a standard 1-based 2D array returned by Range.Value2, with a sortable column 2 and available output cells beginning at E2.

Working with class modules#

These utilities are defined as class methods. Some use Me internally, so simply pasting every class procedure into a standard module is not a drop-in replacement. Retain the class-module organization.

For enum members such as eAND, eOR and eGreater, consult the enumerations reference. Some member names are shared between different enum types.