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

Validators Module

This module contains a set of functions for validating some commonly used string, such as validators for email addresses and phone numbers.


=CreditCardName(string1)

This function checks if a string is a valid credit card from one of the major card issuing companies, and then returns the name of the credit card name. This function assumes no spaces or hyphens (if you have card numbers with spaces or hyphens you can remove these using =SUBSTITUTE("-", "") function.

Arguments

{String}: string1   ➔   is the credit card string


Returns

{String}: Returns the name of the credit card. Currently supports these cards: Visa, MasterCard, Discover, Amex, Diners, JCB


Examples

  • =CreditCardName("5111567856785678") -> "MasterCard"; This is a valid Mastercard number
  • =CreditCardName("not_a_card_number") -> #VALUE!

=FormatCreditCard(string1)

This function checks if a string is a valid credit card, and if it is formats it in a more readable way. The format used is XXXX-XXXX-XXXX-XXXX.

Arguments

{String}: string1   ➔   is credit card number


Returns

{String}: Returns a string formatted as a more readable credit card number


Examples

  • =FormatCreditCard("5111567856785678") -> "5111-5678-5678-5678"

=IsCreditCard(string1)

This function checks if a string is a valid credit card from one of the major card issuing companies.

Arguments

{String}: string1   ➔   is the string we are checking if its a valid credit card number


Returns

{Boolean}: Returns TRUE if the string is a valid credit card number, and FALSE if its invalid. Currently supports these cards: Visa, MasterCard, Discover, Amex, Diners, JCB


Examples

  • =IsCreditCard("5111567856785678") -> TRUE; This is a valid Mastercard number
  • =IsCreditCard("511156785678567") -> FALSE; Not enough digits
  • =IsCreditCard("9999999999999999") -> FALSE; Enough digits, but not a valid card number
  • =IsCreditCard("Hello World") -> FALSE

=IsEmail(string1)

This function checks if a string is a valid email address.

Arguments

{String}: string1   ➔   is the string we are checking if its a valid email


Returns

{Boolean}: Returns TRUE if the string is a valid email, and FALSE if its invalid


Examples

  • =IsEmail("JohnDoe@testmail.com") -> TRUE
  • =IsEmail("JohnDoe@test/mail.com") -> FALSE
  • =IsEmail("not_an_email_address") -> FALSE

=IsIPFour(string1)

This function checks if a string is a valid IPv4 address.

Arguments

{String}: string1   ➔   is the string we are checking if its a valid IPv4 address


Returns

{Boolean}: Returns TRUE if the string is a valid IPv4, and FALSE if its invalid


Examples

  • =IsIPFour("0.0.0.0") -> TRUE
  • =IsIPFour("100.100.100.100") -> TRUE
  • =IsIPFour("255.255.255.255") -> TRUE
  • =IsIPFour("255.255.255.256") -> FALSE; as the final 256 makes the address outside of the bounds of IPv4
  • =IsIPFour("0.0.0") -> FALSE; as the fourth octet is missing

=IsMacAddress(string1)

This function checks if a string is a valid 48-bit Mac Address.

Arguments

{String}: string1   ➔   is the string we are checking if its a valid 48-bit Mac Address


Returns

{Boolean}: Returns TRUE if the string is a valid 48-bit Mac Address, and FALSE if its invalid


Examples

  • =IsMacAddress("00:25:96:12:34:56") -> TRUE
  • =IsMacAddress("FF:FF:FF:FF:FF:FF") -> TRUE
  • =IsMacAddress("00-25-96-12-34-56") -> TRUE
  • =IsMacAddress("123.789.abc.DEF") -> TRUE
  • =IsMacAddress("Not A Mac Address") -> FALSE
  • =IsMacAddress("FF:FF:FF:FF:FF:FH") -> FALSE; the H at the end is not a valid Hex number

=IsPhone(string1)

This function checks if a string is a phone number is valid.

Arguments

{String}: string1   ➔   is the string we are checking if its a valid phone number


Returns

{Boolean}: Returns TRUE if the string is a valid phone number, and FALSE if its invalid


Examples

  • =IsPhone("123 456 7890") -> TRUE
  • =IsPhone("1234567890") -> TRUE
  • =IsPhone("1-234-567-890") -> FALSE; Not enough digits
  • =IsPhone("1-234-567-8905") -> TRUE
  • =IsPhone("+1-234-567-890") -> FALSE; Not enough digits
  • =IsPhone("+1-234-567-8905") -> TRUE
  • =IsPhone("+1-(234)-567-8905") -> TRUE
  • =IsPhone("+1 (234) 567 8905") -> TRUE
  • =IsPhone("1(234)5678905") -> TRUE
  • =IsPhone("123-456-789") -> FALSE; Not enough digits
  • =IsPhone("Hello World") -> FALSE; Not a phone number

=IsUrl(string1)

This function checks if a string is a valid URL address.

Arguments

{String}: string1   ➔   is the string we are checking if its a valid URL


Returns

{Boolean}: Returns TRUE if the string is a valid URL, and FALSE if its invalid


Examples

  • =IsUrl("https://www.wikipedia.org/") -> TRUE
  • =IsUrl("http://www.wikipedia.org/") -> TRUE
  • =IsUrl("hello_world") -> FALSE