Macro to Reverse Text in Excel

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

User Defined Function to Reverse A String

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

How to use codes shared here?