All Projects → todar → VBA-Arrays

todar / VBA-Arrays

Licence: MIT License
😎 Array functions that are similar JavaScript functions. Example: Push, Pop, Shift, Unshift, Sort, length, toString.

Programming Languages

vba
158 projects

Projects that are alternatives of or similar to VBA-Arrays

Pgo
Go library for PHP community with convenient functions
Stars: ✭ 51 (+6.25%)
Mutual labels:  functions, filter, array
Laravel Api Handler
Package providing helper functions for a Laravel REST-API
Stars: ✭ 150 (+212.5%)
Mutual labels:  query, filter
Queryql
Easily add filtering, sorting, and pagination to your Node.js REST API through your old friend: the query string!
Stars: ✭ 76 (+58.33%)
Mutual labels:  query, filter
elastic-composer
Client-side Elasticsearch query generator and executor. Filter fields, find search suggestions, and paginate query results for your indicies using a simple, reactive, and high-level API
Stars: ✭ 14 (-70.83%)
Mutual labels:  query, filter
Queryablelist
Python module to add support for ORM-style filtering to any list of items
Stars: ✭ 19 (-60.42%)
Mutual labels:  query, filter
Lara Eye
Filter your Query\Builder using a structured query language
Stars: ✭ 39 (-18.75%)
Mutual labels:  query, filter
VBA-Better-Array
An array class for VBA providing features found in more modern languages
Stars: ✭ 77 (+60.42%)
Mutual labels:  excel, array
StackFlowView
Enforce stack behaviour for custom UI flow.
Stars: ✭ 35 (-27.08%)
Mutual labels:  pop, push
express-mquery
Expose mongoose query API through HTTP request.
Stars: ✭ 37 (-22.92%)
Mutual labels:  query, filter
spring-filter
Painless filtering library for JPA entities and MongoDB collections. Smoothly integrates with Spring APIs.
Stars: ✭ 123 (+156.25%)
Mutual labels:  query, filter
Walkable
A Clojure(script) SQL library for building APIs: Datomic® (GraphQL-ish) pull syntax, data driven configuration, dynamic filtering with relations in mind
Stars: ✭ 384 (+700%)
Mutual labels:  query, filter
linqjs
use linq and lambda in javascript on es6, can use linq function in an Object or an Array or a String value | 一个方便对数组、字典、树形数据进行操作、筛选等操作的工具库
Stars: ✭ 17 (-64.58%)
Mutual labels:  query, array
Graphql To Mongodb
Allows for generic run-time generation of filter types for existing graphql types and parsing client requests to mongodb find queries
Stars: ✭ 261 (+443.75%)
Mutual labels:  query, filter
Eloquentfilter
An Eloquent Way To Filter Laravel Models And Their Relationships
Stars: ✭ 1,113 (+2218.75%)
Mutual labels:  query, filter
Array Functions
Some handy array functions
Stars: ✭ 215 (+347.92%)
Mutual labels:  functions, array
php-helpers
An extensive set of PHP helper functions and classes.
Stars: ✭ 27 (-43.75%)
Mutual labels:  functions, array
Vscode Data Preview
Data Preview 🈸 extension for importing 📤 viewing 🔎 slicing 🔪 dicing 🎲 charting 📊 & exporting 📥 large JSON array/config, YAML, Apache Arrow, Avro, Parquet & Excel data files
Stars: ✭ 245 (+410.42%)
Mutual labels:  excel, array
invokable
Objects are functions! Treat any Object or Class as a Proc (like Enumerable but for Procs).
Stars: ✭ 40 (-16.67%)
Mutual labels:  functions, array
go-streams
Stream Collections for Go. Inspired in Java 8 Streams and .NET Linq
Stars: ✭ 127 (+164.58%)
Mutual labels:  filter, array
jellex
TUI to filter JSON and JSON Lines data with Python syntax
Stars: ✭ 41 (-14.58%)
Mutual labels:  query, filter

VBA Arrays

A whole bunch of Array functions to make it easier and faster coding. Many functions are to try and mimic JavaScript. Example: Push, Pop, Shift, Unshift, Splice, Sort, Reverse, length, toString.

Buy Me A Coffee


Other Helpful Resources

  • www.roberttodar.com About me and my background and some of my other projects.
  • Style Guide A guide for writing clean VBA code. Notes on how to take notes =)
  • Boilerplate Boilerplate that contains a bunch of helper libraries such as JSON tools, Code Analytics, LocalStorage, Unit Testing, version control and local network distribution, userform events, and more!
  • Strings String function library. ToString, Inject, StringSimilarity, and more.
  • Analytics Way of tracking code analytics and metrics. Useful when multiple users are running code within a shared network.
  • Userform EventListener Listen to events such as mouseover, mouseout, focus, blur, and more.

List of Available Functions

Function Name Description
ArrayAverage Returns the average of all the numbers inside an array.
ArrayContainsEmpties Returns True if the array contains any empties.
ArrayDimensionLength Returns the dimensionlenght of the array.
ArrayExtractColumn Extracts a column from a 2 dim array and returns it as a 1 dim array
ArrayExtractRow Extracts a row from a 2 dim array and returns it as a 1 dim array
ArrayFilter Uses regex to filter items in a single dim array
ArrayFilterTwo Uses regex to filter items in a two dim array.
ArrayFromRecordset Converts a recordset into a 2 dim array including it's headers
ArrayGetColumnIndex Return the column index based on the header name
ArrayGetIndexes Returns a single dim array of the indexes of column headers
ArrayIncludes Checks to see if a value is in single dim array
ArrayIndexOf Returns the index of an item in a single dim array
ArrayLength Returns the number of items in an array
ArrayPluck Extracts a list of a given property. Must be array of dictionries
ArrayPop Removes the last element in array, returns the popped element
ArrayPush Adds a new element(s) to an array (at the end), returns the new array length
ArrayPushTwoDim Adds a new element(s) to an array (at the end). Must be full row of data
ArrayQuery Saves array in CSV file and allows the ability to run ADODB queries on it.
ArrayRemoveDuplicates Removed duplicates from single dim array
ArrayReverse Reverse array (can be used after sort to get the descending order)
ArrayShift Removes element from array - returns removed element
ArraySort Sort an array
ArraySplice Changes the contents of an array by removing or replacing existing elements and/or adding new elements.
ArraySpread Spreads out an array into a single array. example: jagged arrays, dictionaries, collections.
ArraySum Returns the Sum of a single dim array containing numbers
ArrayToCSVFile Saves a two dim array to a CSV file
ArrayToString Returns a string from a 1 or 2 dim array, separated by optional delimiter and vbnewline for each row
ArrayTranspose Application.Transpose has a limit on the size of the array and is limited to the 1st dim. This fixes those issues.
ArrayUnShift Adds a new element to the begining of the array
Assign Quick tool to either set or let depending on if element is an object
ConvertToArray Convert other list type objects to an array
IsArrayEmpty This function tests whether the array is empty (unallocated). Returns TRUE or FALSE.

How to use

  1. Import ArrayFunctions.bas file.
  2. Set a reference to Microsoft Scripting Runtime as this uses dictionaries for removing duplicates.

Examples

Below are some of the examples you can do with single dim arrays. Note, there are several functions for two dim arrays as well.

'EXAMPLES OF VARIOUS FUNCTIONS
Private Sub arrayFunctionExamples()
    ' For simplicity using `a` as the variable. Otherwise, don't do that in your real code! =)
    Dim a As Variant

    ' Single dim functions that manipulate the array.
    ArrayPush a, "Banana", "Apple", "Carrot" '--> Banana,Apple,Carrot
    ArrayPop a                               '--> Banana,Apple --> returns Carrot
    ArrayUnShift a, "Mango", "Orange"        '--> Mango,Orange,Banana,Apple
    ArrayShift a                             '--> Orange,Banana,Apple
    ArraySplice a, 2, 0, "Coffee"            '--> Orange,Banana,Coffee,Apple
    ArraySplice a, 0, 1, "Mango", "Coffee"   '--> Mango,Coffee,Banana,Coffee,Apple
    ArrayRemoveDuplicates a                  '--> Mango,Coffee,Banana,Apple
    ArraySort a                              '--> Apple,Banana,Coffee,Mango
    ArrayReverse a                           '--> Mango,Coffee,Banana,Apple

    ' Array properties functions.
    ' These get details of the array: index of items, lenght, ect.
    ArrayLength a                            '--> 4
    ArrayIndexOf a, "Coffee"                 '--> 1
    ArrayIncludes a, "Banana"                '--> True
    arrayContains a, Array("Test", "Banana") '--> True
    ArrayContainsEmpties a                   '--> False
    ArrayDimensionLength a                   '--> 1 (single dim array)
    IsArrayEmpty a                           '--> False

    ' Here is an example of a jagged array.
    a = Array(1, 2, 3, Array(4, 5, 6, Array(7, 8, 9)))

    ' Can flatten jagged array with the spread formula. Note this is a deep spread.
    ' This formula also spreads dictionaires and collections as well!
    a = ArraySpread(a)                       '--> 1,2,3,4,5,6,7,8,9

    ' Math function examples
    ArraySum a                               '--> 45
    ArrayAverage a                           '--> 5

    ' Filter use's regex pattern
    a = Array("Banana", "Coffee", "Apple", "Carrot", "Canolope")
    a = ArrayFilter(a, "^Ca|^Ap")

    ' Array to string works with both single and double dim arrays!
    Debug.Print ArrayToString(a)
End Sub
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].