![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 1
|
A colleague has started sending mail to me in this format and I would like to be able to return the favor without asking his secret. How do I reverse & invert text as shown below:
pot ot mottob morf...esrever ot detrevnoc uoy woh tuo erugif t'nac I |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
|
Something like this would do it:
HTH |
|
|
|
|
|
#3 |
|
BatCoder
Join Date: Feb 2002
Location: Turkey
Posts: 764
|
This is the function which would do that:
Function Reversed(originaltext As String) As String Dim i As Integer For i = Len(originaltext) To 1 Step -1 Reversed = Reversed & Mid(originaltext, i, 1) Next i End Function If you want to use this function in excel (we are in MrExcel Open VBE and insert a module in related VBA project. Paste the code above. Goto excel sheet and write something reversed A1 and put this function into A2. =REVERSED(A1) you will see the re-reversed text in A2. Regards |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Download (and add-in) morefunc.zip at http://perso.wanadoo.fr/longre/excel/downloads/, and use the following array formula...
{=MCONCAT(MID(A1,LEN(A1)+1-ROW(INDIRECT("1:"&LEN(A1))),1))} Note: Array formulas must be entered using the Control+Shift+Enter key combination. The outermost braces, { }, are not entered by you -- they're supplied by Excel in recognition of a properly entered array formula. |
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
How about the following code:
Sub ReverseWords() It will reverse the text word by word. _________________ Kind regards, ALCHARA [ This Message was edited by: Al Chara on 2002-07-31 08:51 ] [ This Message was edited by: Al Chara on 2002-07-31 08:54 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|