How can I reverse the order of text on a Excel cell
I'm running Windows Xp along with Ms Office 2003 on my system. I would like to know that how can i reverse the order of text on a Excel cell. Can any body provide me the correct solution for the above issue? Does any body knows about it? Any kind of information on the above issue would be appreciated.
Re: How can I reverse the order of text on a Excel cell
You can use the following code, in order to reverse the order of text on a Excel cell.
Quote:
Dim i As Integer
Dim StrNewNum As String
Dim strOld As String
strOld = Trim(Rcell)
For i = 1 To Len(strOld)
StrNewNum = Mid(strOld, i, 1) & StrNewNum
Next i
If IsText = False Then
ReverseCell = CLng(StrNewNum)
Else
ReverseCell = StrNewNum
End If
End Function
Re: How can I reverse the order of text on a Excel cell
In order to reverse the character order, create and add a Custom Function to the Insert Function dialog box.
1. For that you need to Press Alt+F11 in order to open the VBE.
2. Then on VBAProject, you need to select any workbook name and insert a new Module by selecting Module from the Insert menu.
3. Then on the Module sheet, you need to type the code lines.
4. Then press Alt+F11 in order to return to Excel.
5. Afterwards, select a cell and press Shift+F3 in order to open and then Insert Function dialog box.
6. Then, from the User Defined category, you need to insert the ReverseText function.
Re: How can I reverse the order of text on a Excel cell
In order to reverse the order of text on a Excel cell, you need to use the following code on your pc.
Quote:
Function Reverse(Text as String) as String
Dim i As Integer
Dim StrNew As String
Dim strOld As String
strOld = Trim(Text)
For i = 1 To Len(strOld)
StrNew = Mid(strOld, i, 1) & StrNew
Next i
Reverse = StrNew
End Function