Search This Blog

Sunday, March 6, 2016

Reverse String (Arabic, English) in Excel

Requirement:

Some seeded reports in the Apps R12 , where arabic text was reverse, So the end user wants any solution urgently in excel if report exported .



Reverse the String:

1.       Open Excel Press Alt + F11 Visual basic will open.
2.       Click Insert > Module
Paste the below code:
Function ReverseString(rngString As Range, Optional strDelim As String = " ") As String
    Dim vStrings As Variant, lngString As Long
    vStrings = Split(rngString, strDelim)
    For lngString = UBound(vStrings) To LBound(vStrings) Step -1
        ReverseString = ReverseString & strDelim & vStrings(lngString)
    Next lngString
    ReverseString = Replace(ReverseString, strDelim, "", 1, 1)
End Function


3.       Save the excel file as ReverseString and file type as Excel Add-In(*.xlam)
4.       Goto file>options>Add-Ins>Manage(Excel Add-Ins)> Go
5.       Check-in your new add-in and click ok.
6.       Just close the excel file, if its ask for save click cancel.
7.       Open the excel again and test the ReverseSTring function will be shown in any of the excel file.



No comments:

Post a Comment