How to Reverse a string in Microsoft Excel ?

There are times when you might want to reverse a string or text in a cell in Excel to achieve some objectives. Well, there are NO direct or built-in function to achieve this but one could create a User Defined Function using VBA and call the same via the formula.

How to Reverse a string in Microsoft Excel ?

1. Press the keyboard shortcut key ALT + F11 to display the Microsoft Visual Basic for Applications dialog.

2. In the “Microsoft Visual Basic for Applications” dialog , Click Insert –> Module and then enter the following code in to the editor.

Function Reverse(str As String) As String
    Reverse = StrReverse(Trim(str))
End Function

3. Save the changes and then close the “Microsoft Visual Basic for Applications” dialog.

4. Navigate back to the worksheet where you want to display the reverse of a string and enter the following formula and specify the cell for which you need to find the reverse of the string.

image

Leave A Reply

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

You May Also Like

In this post, you’ll learn how to Find Blank cells in excel so that you can remove or delete the blank cells form...
In this article, you’ll learn what is a Gauge Chart in Microsoft Excel. Also, you will learn how to add...
Microsoft Excel provides a shortcut for the users to move columns in excel using two different ways – using Shift...