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

Random Module

This module contains a set of functions for generating and sampling random data.


=BigRandBetween(minNumber, maxNumber)

This function is an implementation of RandBetween that allows for 14-byte integers to be used

Arguments

{Variant}: minNumber   ➔   is the minimum number in the range

{Variant}: maxNumber   ➔   is the maximum number in the range


Returns

{Variant}: Returns a random number between the range


Examples

  • =RandBetween(0, 3000000000) -> Error; as RandBetween only works with 4-byte and less integers
  • =BigRandBetween(0, 3000000000) -> 2116642535; as BigRandBetween supports up to 14-byte integers

=RandBetween(minNumber, maxNumber)

This function returns a random number between the min and max numbers

Arguments

{Long}: minNumber   ➔   is the minimum number in the range

{Long}: maxNumber   ➔   is the maximum number in the range


Returns

{Variant}: Returns a random number between the range


Examples

  • =RandBetween(1, 20) -> 5
  • =RandBetween(1, 20) -> 9
  • =RandBetween(1, 20) -> 13
  • =RandBetween(1, 20) -> 2
  • =RandBetween(1, 20) -> 20
  • =RandBetween(1, 20) -> 6

=RandBetweens(startOrEndNumberArray)

This function is similar to RANDBETWEEN, except that it allows multiple ranges from which to pick a random number. One of the ranges from which to generate a random number between is chosen at an equal probably.

Arguments

{Variant}: startOrEndNumberArray()   ➔   


Returns

{Variant}: Returns either TRUE or FALSE based on the random value choosen


Note
This function always requires an even number of inputs. Essentially, when using multiple numbers, the 1st and 2nd will make up a range from which to pull a random number between, the 3rd and 4th will make a different range, and so on. If an even number is used, this function will return a User-Defined Error. See the ISERRORALL() function for how to handle these numbers.

Examples

  • =RandBetweens(1, 10, 5000, 5010) -> 6
  • =RandBetweens(1, 10, 5000, 5010) -> 5002
  • =RandBetweens(1, 10, 5000, 5010) -> 8
  • =RandBetweens(1, 10, 5000, 5010) -> 3
  • =RandBetweens(1, 10, 5000, 5010) -> 5010
  • =RandBetweens(1, 10, 5000, 5010) -> 2
  • =RandBetweens(5, 10, 15, 20, 25, 30, 35, 40) -> 32

=RandBool()

This function generates a random Boolean (TRUE or FALSE) value

Arguments

None


Returns

{Boolean}: Returns either TRUE or FALSE based on the random value choosen


Examples

  • =RandBool() -> TRUE
  • =RandBool() -> FALSE
  • =RandBool() -> TRUE
  • =RandBool() -> TRUE
  • =RandBool() -> FALSE
  • =RandBool() -> FALSE

=RandomRange(startNumber, stopNumber, stepNumber)

This function takes 3 numbers, a start number, a stop number, and a step number, and returns a random number between the start number and stop number that is an interval of the step number.

Arguments

{Long}: startNumber   ➔   is the beginning value of the range

{Long}: stopNumber   ➔   is the end value of the range

{Long}: stepNumber   ➔   is the step of the range


Returns

{Long}: Returns a random number between the start and stop that is a multiple of the step


Examples

  • =RandomRange(50, 100, 10) -> 60
  • =RandomRange(50, 100, 10) -> 50
  • =RandomRange(50, 100, 10) -> 90
  • =RandomRange(0, 10, 2) -> 8
  • =RandomRange(0, 10, 2) -> 0
  • =RandomRange(0, 10, 2) -> 4
  • =RandomRange(0, 10, 2) -> 10

=RandomSample(variantArray)

This function takes an array of cells and returns a random value from the cells chosen

Arguments

{Variant}: variantArray   ➔   a single cell or multiple cells where the sample will be pulled from


Returns

{Variant}: Returns a random cell value from the array of cells chosen


Examples

  • =RandomSample(A1:A5) -> "Hello"; where "Hello" is the value in cell A3, and where A3 was the chosen random cell
  • =RandomSample(A1:A5) -> "World"; where "World" is the value in cell A2, and where A2 was the chosen random cell