-
-
Notifications
You must be signed in to change notification settings - Fork 0
Rodrigo Celso de Lima Porto edited this page Jan 12, 2026
·
5 revisions
Compares two arrays to check if they are equal, meaning they have the same size and identical elements in the same order.
AreArraysEqual( _
Array1 As Variant, _
Array2 As Variant _
) As Boolean-
Array1: First array to compare -
Array2: Second array to compare
Returns True if both arrays are equal, False otherwise.
- Arrays must have the same upper and lower bounds
- Arrays must have identical elements in the same positions
- The function performs an element-by-element comparison
- Returns
Falseif arrays have different sizes - Can compare arrays of any type since parameters are declared as Variant
Dim arr1 As Variant: arr1 = Array(1, 2, 3)
Dim arr2 As Variant: arr2 = Array(1, 2, 3)
If AreArraysEqual(arr1, arr2) Then
Debug.Print "Arrays are equal"
Else
Debug.Print "Arrays are different"
End IfAutomatically fills formulas across a range using a reference cell's formula. The reference cell can be either the first or last cell containing a formula in the range.
AutoFillFormulas( _
rng As Range, _
Optional UseLastCellAsRef As Boolean = False _
)-
rng: The range where formulas will be filled -
UseLastCellAsRef: (optional) Boolean flag to determine which cell to use as reference-
False(Default): Uses the first cell with formula as reference -
True: Uses the last cell with formula as reference
-
- Does nothing if the range is empty (Nothing) or contains only one cell
- Only works if the range contains at least one formula
- Uses R1C1 formula notation to ensure proper relative references when filling
- Only fills formulas in cells that are part of the specified range
- Requires the helper function
RangeHasAnyFormulato check for formulas in the range
Dim rng As Range
Set rng = Range("A1:A10")
AutoFillFormulas rng 'Uses first formula cell as reference
'Or using the last cell as reference:
AutoFillFormulas rng, TrueCleans a string by removing or replacing special and control characters with spaces.
CleanString( _
myString As String, _
Optional ReplaceBySpace As Boolean = True, _
Optional ConvertNonBreakingSpace As Boolean = True _
) As String-
myString: The input string to be cleaned -
ReplaceBySpace: (optional) Boolean flag that determines if special characters should be replaced by spaces-
True(Default): Replaces special characters with spaces -
False: Removes special characters without replacement
-
-
ConvertNonBreakingSpace: (optional) Boolean flag to handle non-breaking spaces-
True(Default): Converts non-breaking spaces (ASCII 160) to regular spaces -
False: Leaves non-breaking spaces unchanged
-
Returns the cleaned string with special characters either removed or replaced by spaces.
- Removes ASCII control characters (0-31)
- Handles special characters like ASCII 127, 129, 141, 143, 144, and 157
- Converts non-breaking spaces to regular spaces (when enabled)
- Trims leading and trailing spaces from the final result
- Preserves all other printable characters
Dim cleanedStr As String
' Replace special characters with spaces
cleanedStr = CleanString("Hello" & Chr(0) & "World")
Debug.Print cleanedStr ' Result: "Hello World"
' Remove special characters
cleanedStr = CleanString("Hello" & Chr(0) & "World", False)
Debug.Print cleanedStr ' Result: "HelloWorld"
' Keep non-breaking spaces
cleanedStr = CleanString("Hello" & Chr(160) & "World", True, False)
Debug.Print cleanedStr ' Result: Original string unchanged- Binary.Unzip πβοΈ
- DateTime.ToUnixTime πβοΈ
- Decision.EntropyWeights πβοΈ
- Decision.TOPSIS πβοΈ
- List.Correlation πβοΈ
- List.Intercept πβοΈ
- List.Outliers πβοΈ
- List.PopulationStdDev πβοΈ
- List.Primes πβοΈ
- List.Rank πβοΈ
- List.Slope πβοΈ
- List.Variance πβοΈ
- List.WeightedAverage πβοΈ
- Number.FromRoman πβοΈ
- Number.IsInteger πβοΈ
- Number.IsPrime πβοΈ
- Number.ToRoman πβοΈ
- Statistical.NormDist πβοΈ
- Statistical.NormInv πβοΈ
- Table.AddColumnFromList πβοΈ
- Table.CorrelationMatrix πβοΈ
- Table.NormalizeColumnNames πβοΈ
- Table.NormalizeTextColumns πβοΈ
- Table.RemoveBlankColumns πβοΈ
- Table.TransposeCorrectly πβοΈ
- Text.CountChar πβοΈ
- Text.ExtractNumbers πβοΈ
- Text.HtmlToPlainText πβοΈ
- Text.RegexExtract πβοΈ
- Text.RegexReplace πβοΈ
- Text.RegexSplit πβοΈ
- Text.RegexTest πβοΈ
- Text.RemoveAccents πβοΈ
- Text.RemoveDoubleSpaces πβοΈ
- Text.RemoveLetters πβοΈ
- Text.RemoveNumerals πβοΈ
- Text.RemovePunctuations πβοΈ
- Text.RemoveStopwords πβοΈ
- Text.RemoveWeirdChars πβοΈ
- AreArraysEquals πβοΈ
- AutoFillFormulas πβοΈ
- CleanString πβοΈ
- DisableRefreshAll πβοΈ
- EnableRefreshAll πβοΈ
- FileExists πβοΈ
- FileNameIsValid πβοΈ
- GetAllFileNames πβοΈ
- GetLetters πβοΈ
- GetMonthNumberFromName πβοΈ
- GetStringBetween πβοΈ
- GetStringWithSubstringInArray πβοΈ
- GetTableColumnNames πβοΈ
- IsAllTrue πβοΈ
- IsInArray πβοΈ
- ListObjectExists πβοΈ
- PreviousMonthNumber πβοΈ
- RangeHasAnyFormula πβοΈ
- RangeHasConstantValues πβοΈ
- RangeIsHidden πβοΈ
- RangeToHtml πβοΈ
- SendEmail πβοΈ
- SetQueryFormula πβοΈ
- StringContains πβοΈ
- StringEndsWith πβοΈ
- StringStartsWith πβοΈ
- SubstringIsInArray πβοΈ
- Summation πβοΈ
- TableHasQuery πβοΈ
- WorksheetHasListObject πβοΈ