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#
- Desktop Microsoft Excel with the VBA editor.
- Microsoft Scripting Runtime enabled under Tools → References (used for
Dictionary). - The three VBA class modules
Arrays,FinanceandOthersfrom your library source.
Manual installation#
- Download and extract the VBA-DataKit ZIP. Locate the Arrays, Finance and Others .cls files.
- Open the destination workbook in Excel, press Alt + F11, then choose File → Import File… for each .cls module. Keep the exact class names.
- In the destination project, enable Microsoft Scripting Runtime using Tools → References.
- In a standard module, define the three shared instances shown below. Remove duplicate declarations if your workbook already has them.
- Run Debug → Compile VBAProject, then save the destination workbook as
.xlsm.
Public Arr As New Arrays
Public Fin As New Finance
Public Others As New OthersFinance uses the global Arr object internally for array-shape utilities. If you import Finance, include Arrays and the Arr declaration above.
Quick usage example#
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 SubThe 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.