Results 1 to 3 of 3

Thread: Text Direction from right to left in Excel

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2005
    Posts
    17

    Text Direction from right to left in Excel

    Hello,

    How to set the text direction from right to left in Excel using the VBA. Thanks.

    Regards
    Odeh

  2. #2
    Addicted Member malik641's Avatar
    Join Date
    Sep 2005
    Location
    South Florida :-)
    Posts
    221

    Re: Text Direction from right to left in Excel

    Thanks to John Walkenbach's book: Microsoft Excel 2000 Formulas
    VB Code:
    1. Function REVERSETEXT(text) As String
    2. 'Returns its argument, reversed
    3. Dim TextLen As Integer
    4. Dim i As Integer
    5. TextLen = Len(text)
    6. For i = TextLen To 1 Step -1
    7.     REVERSETEXT = REVERSETEXT & Mid(text, i, 1)
    8. Next i
    9. End Function
    Use this in a cell as:

    =REVERSETEXT(A1)

    Where A1 would have your text.
    HTH




    If you find any of my posts of good help, please rate it

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2005
    Posts
    17

    Re: Text Direction from right to left in Excel

    Many Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width