reverse characters in a cell

  • Thread starter Thread starter Meg
  • Start date Start date
M

Meg

Is there a way within Excel to reverse the characters in
an Excel spreadsheet (i.e., the cell reads 1234 and I want
it to be "transposed" to read 4321)?
 
Hi:

You would probably need to use a UDF (user-defined function) such as the
following:

Function Mirror(rng As Range) As String
Dim i As Integer
For i = Len(rng.Value) To 1 Step -1
Mirror = Mirror & Mid(rng.Value, i, 1)
Next
End Function

If you paste this function into a module, entering:

=Mirror(A1)

into a cell will result in a string that is the mirror image of the contents
of A1.

Regards,

Vasant.



Regards,

Vasant.
 
You could try

=MID(A1,5,1)&MID(A1,4,1)&MID(A1,3,1)&MID(A1,2,1)&MID
(A1,1,1)

It appears written for 5 characters, but it worked fine
for 1234. You would have to figure an upper limit on the
number of characters in any cell.
 
Back
Top