Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35
Default Reverse Text by Word??

I have several thousand rows with data similar to this:
Hen_On_NestRoosterwareChickenroosterKitchen

Is it possible to reverse them so that they will read like this:
KitchenChickenroosterRoosterwareHen_On_Nest

In other words -- reverse the order -- enter the words from right to
left, instead of left to right (as they are now)??

Thanks.

Barb

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 427
Default Reverse Text by Word??

How about: use the Text to Columns feature, using the as your
delimiter. This will split the strings into different columns; then
write a formula along the lines of =D1&C1&B1&A1 to reverse the word
order.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Reverse Text by Word??

Enter this small macro, then select the cells you want to convert and run the
macro.


Sub backwards()
Dim r As Range, st As String
For Each r In Selection
s = Split(r.Value, "")
u = UBound(s)
If u 0 Then
st = s(u)
For i = u - 1 To 0 Step -1
st = st & "" & s(i)
Next
r.Value = st
End If
Next

If you are not familiar with macros, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm


--
Gary's Student


"The Moose" wrote:

I have several thousand rows with data similar to this:
Hen_On_NestRoosterwareChickenroosterKitchen

Is it possible to reverse them so that they will read like this:
KitchenChickenroosterRoosterwareHen_On_Nest

In other words -- reverse the order -- enter the words from right to
left, instead of left to right (as they are now)??

Thanks.

Barb


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35
Default Reverse Text by Word??

You guys are *AMAZING*!! I can't tell you how much I appreciate the
help that you've both offered to me. Turned out, I was able to use
both methods on this monster project of mine!!

Thanks again.

Barb


Gary''s Student wrote:
Enter this small macro, then select the cells you want to convert and run the
macro.


Sub backwards()
Dim r As Range, st As String
For Each r In Selection
s = Split(r.Value, "")
u = UBound(s)
If u 0 Then
st = s(u)
For i = u - 1 To 0 Step -1
st = st & "" & s(i)
Next
r.Value = st
End If
Next

If you are not familiar with macros, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm


--
Gary's Student


"The Moose" wrote:

I have several thousand rows with data similar to this:
Hen_On_NestRoosterwareChickenroosterKitchen

Is it possible to reverse them so that they will read like this:
KitchenChickenroosterRoosterwareHen_On_Nest

In other words -- reverse the order -- enter the words from right to
left, instead of left to right (as they are now)??

Thanks.

Barb



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
How to Transfer data from Text Form Fields in MS Word into Excel? CWillis Excel Discussion (Misc queries) 1 July 18th 06 06:35 AM
How to export text from Excel to Word Rock Excel Discussion (Misc queries) 2 May 14th 06 12:32 AM
How to export text from Excel to Word Rock New Users to Excel 2 May 14th 06 12:32 AM
Text disappears when word wrap is used Mark_GS1CA Excel Discussion (Misc queries) 12 October 17th 05 12:44 PM
Text not copying as text from Word to Excel 2003 Christine Excel Discussion (Misc queries) 4 March 3rd 05 11:33 PM


All times are GMT +1. The time now is 01:30 PM.

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"