REVERSE

Returns the contents of a cell with all the characters reversed.


Remarks

* For instructions on how to add a function to a workbook refer to the page under Inserting Functions
* The equivalent JavaScript function is REVERSE


'sCellContents - The number or text you want to reverse.

Public Function REVERSE(ByVal sCellContents As String) As String

   If Application.WorksheetFunction.IsNonText(sCellContents) = True Then
      REVERSE = VBA.CVErr(xlCVError.xlErrNA)
   Else
      REVERSE = VBA.StrReverse(sCellContents)
   End If

End Function

If the argument is not a number or a text string, then #N/A is returned.
This uses the built-in VBA function STRREVERSE.

=REVERSE(REVRESE()) = ??


© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext