XLib


Download
Installation
X-VBA Home

Array
=AverageHigh
=AverageLow
=CountUnique
=IsInArray
=Large
=Reverse
=Small
=Sort
=SumHigh
=SumLow

Color
=Hex2Hsl
=Hex2Rgb
=Hsl2Hex
=Hsl2Rgb
=Rgb2Hex
=Rgb2Hsl
=Rgb2Hsv

DateTime
=DaysOfMonth
=MonthName2
=Quarter
=TimeConverter
=WeekOfMonth
=WeekdayName2

Environment
=ComputerName
=OS
=UserDomain
=UserName

File
=CountFiles
=CountFilesAndFolders
=CountFolders
=CurrentFilePath
=FileCreationTime
=FileDrive
=FileExtension
=FileFolder
=FileLastModifiedTime
=FileName
=FileSize
=FileType
=GetActivePath
=GetActivePathAndName
=GetFileNameByNumber
=PathJoin
=PathSeparator
=ReadFile
=WriteFile

Math
=Ceil
=Floor
=InterpolateNumber
=InterpolatePercent
=Max
=Min
=ModFloat

Meta
=XlibCredits
=XlibDocumentation
=XlibVersion

Network
=Http
=ParseHtmlString
=SimpleHttp

Random
=BigRandBetween
=RandBetween
=RandBetweens
=RandBool
=RandomRange
=RandomSample

Regex
=RegexReplace
=RegexSearch
=RegexTest

StringManipulation
=CamelCase
=Capitalize
=CompanyCase
=CountLowercaseCharacters
=CountUppercaseCharacters
=CountWords
=DedentText
=EliteCase
=Formatter
=InSplit
=IndentText
=KebabCase
=LeftFind
=LeftSearch
=LeftSplit
=RemoveCharacters
=Repeat
=ReverseText
=ReverseWords
=RightFind
=RightSearch
=RightSplit
=ScrambleCase
=ShortenText
=SplitText
=Substr
=SubstrFind
=SubstrSearch
=TextJoin
=TrimChar
=TrimLeft
=TrimRight
=Zfill

StringMetrics
=Damerau
=Hamming
=Levenshtein

Utilities
=BigDec2Hex
=BigHex
=Dec2Hex
=Hex2Dec
=HideText
=HtmlEscape
=HtmlUnescape
=JavaScript
=Jsonify
=Len2
=SpeakText
=UuidFour

Validators
=CreditCardName
=FormatCreditCard
=IsCreditCard
=IsEmail
=IsIPFour
=IsMacAddress
=IsPhone
=IsUrl

Math Module

This module contains a set of basic mathematical functions where those functions don't already exist as base Excel functions.


=Ceil(number)

This function takes a number and rounds it up to the nearest whole integer

Arguments

{Double}: number   ➔   is the number that will be rounded up


Returns

{Long}: Returns the number rounded up to the nearest integer


Examples

  • =Ceil(1.5) -> 2
  • =Ceil(1.0001) -> 2
  • =Ceil(1.0) -> 1
  • =Ceil(1) -> 1

=Floor(number)

This function takes a number and rounds it down to the nearest whole integer

Arguments

{Double}: number   ➔   is the number that will be rounded down


Returns

{Long}: Returns the number rounded down to the nearest integer


Examples

  • =Floor(1.9) -> 1
  • =Floor(1.1) -> 1
  • =Floor(1.0) -> 1
  • =Floor(1) -> 1

=InterpolateNumber(startingNumber, endingNumber, interpolationPercentage)

This function takes three numbers, a starting number, an ending number, and an interpolation percent, and linearly interpolates the number at the given percentage between the starting and ending number.

Arguments

{Double}: startingNumber   ➔   is the beginning number of the interpolation

{Double}: endingNumber   ➔   is the ending number of the interpolation

{Double}: interpolationPercentage   ➔   is the percentage that will be interpolated linearly between the startingNumber and the endingNumber


Returns

{Double}: Returns the linearly interpolated number between the two points


Examples

  • =InterpolateNumber(10, 20, 0.5) -> 15; Where 0.5 would be 50% between 10 and 20
  • =InterpolateNumber(16, 124, 0.64) -> 85.12; Where 0.64 would be 64% between 16 and 124

=InterpolatePercent(startingNumber, endingNumber, interpolationNumber)

This function takes three numbers, a starting number, an ending number, and an interpolation number, and linearly interpolates the percentage location of the interpolated number between the starting and ending number.

Arguments

{Double}: startingNumber   ➔   is the beginning number of the interpolation

{Double}: endingNumber   ➔   is the ending number of the interpolation

{Double}: interpolationNumber   ➔   is the number that will be interpolated linearly between the startingNumber and the endingNumber to calculate a percentage


Returns

{Double}: Returns the linearly interpolated percent between the two points given the interpolation number


Examples

  • =InterpolatePercent(10, 18, 12) -> 0.25; As 12 is 25% of the way from 10 to 18
  • =InterpolatePercent(10, 20, 15) -> 0.5; As 15 is 50% of the way from 10 to 20

=Max(numbers)

This function takes multiple numbers or multiple arrays of numbers and returns the max number. This function also accounts for numbers that are formatted as strings by converting them into numbers

Arguments

{Variant}: numbers()   ➔   is a single number, multiple numbers, or multiple arrays of numbers


Returns

{Variant}: Returns the max number


Examples

  • =Max(1, 2, 3) -> 3
  • =Max(4.4, 5, "6") -> 6
  • =Max(x) -> 3; Where x is an array with these values [1, 2.2, "3"]
  • =Max(x, y, 10) -> 15; Where x = [1, 2.2, "3"] and y = [5, 15, -100]

=Min(numbers)

This function takes multiple numbers or multiple arrays of numbers and returns the min number. This function also accounts for numbers that are formatted as strings by converting them into numbers

Arguments

{Variant}: numbers()   ➔   is a single number, multiple numbers, or multiple arrays of numbers


Returns

{Variant}: Returns the min number


Examples

  • =Min(1, 2, 3) -> 1
  • =Min(4.4, 5, "6") -> 4.4
  • =Min(-1, -2, -3) -> -3
  • =Min(x) -> 1; Where x is an array with these values [1, 2.2, "3"]
  • =Min(x, y, 10) -> -100; Where x = [1, 2.2, "3"] and y = [5, 15, -100]

=ModFloat(numerator, denominator)

This function performs modulus operations with floats as the Mod operator in VBA does not support floats.

Arguments

{Double}: numerator   ➔   is the left value of the Mod

{Double}: denominator   ➔   is the right value of the Mod


Returns

{Double}: Returns a double with ModFloat operator performed on it


Examples

  • =ModFloat(3.55, 2) -> 1.55