Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 447
Default transpose characters in a cell (ex: ABC12345 changes to 54321CBA)

I looking to take a column of part numbers (mixed with text and numerals) and
transpose the character position from left-to-right - changing it to
right-to-left. An example would be 5YA124 would change to read 421AY5
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 168
Default transpose characters in a cell (ex: ABC12345 changes to 54321CBA)

Say you are reversing the contents of cell A1, use the code below and
type =ReverseCell(A1,TRUE) in your target cell.


Function ReverseCell(Rcell As Range, Optional IsText As Boolean)
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



HTH,
JP


On Nov 1, 3:06 pm, karen wrote:
I looking to take a column of part numbers (mixed with text and numerals) and
transpose the character position from left-to-right - changing it to
right-to-left. An example would be 5YA124 would change to read 421AY5



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default transpose characters in a cell (ex: ABC12345 changes to 54321CBA)

Try this one line UDF:

Function reverse(r As Range) As String
reverse = StrReverse(r.Value)
End Function

--
Gary''s Student - gsnu200753


"karen" wrote:

I looking to take a column of part numbers (mixed with text and numerals) and
transpose the character position from left-to-right - changing it to
right-to-left. An example would be 5YA124 would change to read 421AY5

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 447
Default transpose characters in a cell (ex: ABC12345 changes to 54321C

Thanks!! this works awesome!!!

"Gary''s Student" wrote:

Try this one line UDF:

Function reverse(r As Range) As String
reverse = StrReverse(r.Value)
End Function

--
Gary''s Student - gsnu200753


"karen" wrote:

I looking to take a column of part numbers (mixed with text and numerals) and
transpose the character position from left-to-right - changing it to
right-to-left. An example would be 5YA124 would change to read 421AY5

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 168
Default transpose characters in a cell (ex: ABC12345 changes to 54321CBA)

Nice job dude


On Nov 1, 3:22 pm, Gary''s Student
wrote:
Try this one line UDF:

Function reverse(r As Range) As String
reverse = StrReverse(r.Value)
End Function

--
Gary''s Student - gsnu200753



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
find first empty cell in column and start transpose next row in that cell ali Excel Discussion (Misc queries) 6 July 21st 07 11:55 PM
Transpose? Offset? Variable starting cell Fin Analyst Excel Discussion (Misc queries) 4 April 26th 06 07:48 AM
Transpose Reletive Cell References? Conan Kelly Excel Worksheet Functions 1 January 12th 06 04:45 PM
I WANT TO TRANSPOSE LINKS, AS WE TRANSPOSE VALUES Umair Aslam Excel Worksheet Functions 1 September 22nd 05 01:19 PM
Transpose-relative cell references would be useful. carlmanaster Excel Worksheet Functions 7 March 15th 05 01:04 AM


All times are GMT +1. The time now is 08:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"