Reversing a string in Excel



In my many years of rummaging through the internet for help, I have seen countless posts where troubled help seekers are told that VBA does not have a built in function to reverse a string. Amature know-alls suggest a makeshift solution using a for-loop; and everyone is happy. Contrary to popular belief, Visual Basics does have a built in function to reverse a string: StrReverse()

For the benefit of Excel-VBA beginners, I thought I would post a Wrapper function that would make this functionality available in the Excel Interface.

Function StringReverse(ByVal WhichString As String) As Variant
 StringReverse = StrReverse(WhichString)
End Function
String Reverse in Excel

Example : Reverse a String

Categories: User Defined FunctionTags: , , ,

3 comments

  1. This is quite amazing! I never knew hat they had such function in Excel 🙂 Thanks for this awesome posting.

    Like

  2. Hi Erica, One thing a Day – Accomplished!

    Even I came to know about this only recently.

    Like

If you liked it, let me know. If you didn't make sure you let me know!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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

%d bloggers like this: