Macro to Reverse Text in Excel


User Defined Function to Reverse A String


Function ReverseString(text As String)
ReverseString = StrReverse(text)
End Function

Reverse strings in a selection


Sub ReverseStringsInASelection()
Dim X As Range
Dim Y As Integer
Y = 0
Set X = Selection
For Each X In Selection
ActiveCell.Offset(Y, 1).Value = StrReverse(X)
Y = Y + 1
Next X
End Sub

Leave a Reply

Your email address will not be published.Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.