ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   SORT RIGHT-TO-LEFT IN EXCEL (https://www.excelbanter.com/excel-worksheet-functions/120031-sort-right-left-excel.html)

apprentice idiot

SORT RIGHT-TO-LEFT IN EXCEL
 
I'd like to sort a row of columns wherein each cell would be sorted
alphabetically but in reverse order; i.e. a cell with the word MICROSOFT
would be sorted as "TFOSORCIM", and one with EXCEL would be sorted as "LECXE"
(This to get groupings of words by their endings: e.g., "-ment", "-ation",
"-ity", "-ship", etc.).

Dave Peterson

SORT RIGHT-TO-LEFT IN EXCEL
 
Can you use a macro?

Are you using xl2k or higher?

If yes to both, you could use a little user defined function like:

Option Explicit
Function ReverseString(myStr As String) As String
ReverseString = StrReverse(myStr)
End Function

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

=======

Short course:
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there.

Now go back to excel to test it out.

Put something like:
=reversestring(a1)
in an adjacent cell

Then copy this down the column and sort your data using this key.

apprentice idiot wrote:

I'd like to sort a row of columns wherein each cell would be sorted
alphabetically but in reverse order; i.e. a cell with the word MICROSOFT
would be sorted as "TFOSORCIM", and one with EXCEL would be sorted as "LECXE"
(This to get groupings of words by their endings: e.g., "-ment", "-ation",
"-ity", "-ship", etc.).


--

Dave Peterson

tim m

SORT RIGHT-TO-LEFT IN EXCEL
 
Interesting question, one of the real gurus might have a solution but I can't
think of a way to easily reverse words. You could try just looking at the
right hand side of your words for grouping, for example try a formula like
this:

=RIGHT(A1,4)

It will give you only the 4 right hand most letters of your word in A1, the
problem of course is the fact that in some case you want to look at the last
4 letter, some the last 3 letters, some the last 5. Perhaps this will put
you on the (pardon the pun) right track.

"apprentice idiot" wrote:

I'd like to sort a row of columns wherein each cell would be sorted
alphabetically but in reverse order; i.e. a cell with the word MICROSOFT
would be sorted as "TFOSORCIM", and one with EXCEL would be sorted as "LECXE"
(This to get groupings of words by their endings: e.g., "-ment", "-ation",
"-ity", "-ship", etc.).


apprentice idiot

SORT RIGHT-TO-LEFT IN EXCEL
 
I'm using Office2007 beta. Unfortunately, the crash course resulted in a
collision with my rank ignorance; and the latter, pulling rank, won.
What module would I paste in and what would be its form?

Also, when I paste in "=reversestring(a1)" into a cell/column, I get "#NAME?"

Please advise.

"Dave Peterson" wrote:

Can you use a macro?

Are you using xl2k or higher?

If yes to both, you could use a little user defined function like:

Option Explicit
Function ReverseString(myStr As String) As String
ReverseString = StrReverse(myStr)
End Function

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

=======

Short course:
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there.

Now go back to excel to test it out.

Put something like:
=reversestring(a1)
in an adjacent cell

Then copy this down the column and sort your data using this key.

apprentice idiot wrote:

I'd like to sort a row of columns wherein each cell would be sorted
alphabetically but in reverse order; i.e. a cell with the word MICROSOFT
would be sorted as "TFOSORCIM", and one with EXCEL would be sorted as "LECXE"
(This to get groupings of words by their endings: e.g., "-ment", "-ation",
"-ity", "-ship", etc.).


--

Dave Peterson


apprentice idiot

SORT RIGHT-TO-LEFT IN EXCEL
 
PS: I had pasted "Option Explicit
Function ReverseString(myStr As String) As String
ReverseString = StrReverse(myStr)
End Function"
into the MACRO as directed, but it made no never mind.


"Dave Peterson" wrote:

Can you use a macro?

Are you using xl2k or higher?

If yes to both, you could use a little user defined function like:

Option Explicit
Function ReverseString(myStr As String) As String
ReverseString = StrReverse(myStr)
End Function

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

=======

Short course:
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there.

Now go back to excel to test it out.

Put something like:
=reversestring(a1)
in an adjacent cell

Then copy this down the column and sort your data using this key.

apprentice idiot wrote:

I'd like to sort a row of columns wherein each cell would be sorted
alphabetically but in reverse order; i.e. a cell with the word MICROSOFT
would be sorted as "TFOSORCIM", and one with EXCEL would be sorted as "LECXE"
(This to get groupings of words by their endings: e.g., "-ment", "-ation",
"-ity", "-ship", etc.).


--

Dave Peterson


apprentice idiot

SORT RIGHT-TO-LEFT IN EXCEL
 
PPS: WHen I tried the MACRO as entered, I received the message: "No RETURN()
or HALT() function found on Macro Sheet". Please advise further.

"Dave Peterson" wrote:

Can you use a macro?

Are you using xl2k or higher?

If yes to both, you could use a little user defined function like:

Option Explicit
Function ReverseString(myStr As String) As String
ReverseString = StrReverse(myStr)
End Function

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

=======

Short course:
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there.

Now go back to excel to test it out.

Put something like:
=reversestring(a1)
in an adjacent cell

Then copy this down the column and sort your data using this key.

apprentice idiot wrote:

I'd like to sort a row of columns wherein each cell would be sorted
alphabetically but in reverse order; i.e. a cell with the word MICROSOFT
would be sorted as "TFOSORCIM", and one with EXCEL would be sorted as "LECXE"
(This to get groupings of words by their endings: e.g., "-ment", "-ation",
"-ity", "-ship", etc.).


--

Dave Peterson


Dave Peterson

SORT RIGHT-TO-LEFT IN EXCEL
 
I haven't seen xl2007, but did you follow the short course and copy that UDF
into a General module?

apprentice idiot wrote:

PPS: WHen I tried the MACRO as entered, I received the message: "No RETURN()
or HALT() function found on Macro Sheet". Please advise further.

"Dave Peterson" wrote:

Can you use a macro?

Are you using xl2k or higher?

If yes to both, you could use a little user defined function like:

Option Explicit
Function ReverseString(myStr As String) As String
ReverseString = StrReverse(myStr)
End Function

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

=======

Short course:
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there.

Now go back to excel to test it out.

Put something like:
=reversestring(a1)
in an adjacent cell

Then copy this down the column and sort your data using this key.

apprentice idiot wrote:

I'd like to sort a row of columns wherein each cell would be sorted
alphabetically but in reverse order; i.e. a cell with the word MICROSOFT
would be sorted as "TFOSORCIM", and one with EXCEL would be sorted as "LECXE"
(This to get groupings of words by their endings: e.g., "-ment", "-ation",
"-ity", "-ship", etc.).


--

Dave Peterson


--

Dave Peterson

apprentice idiot

SORT RIGHT-TO-LEFT IN EXCEL
 
I followed the short course, copied the module into a General module, and
entered "=reversestring(B2)" into all the rows corresponding to the list on
Worksheet1. While each cell thereof asks "#NAME?", the insert function shows
the function argument questioning B2 with #VALUE (in red) after the equal
sign.
I'd be happy to send you a truncated version of the sheet with the UDF and
formula saved in a compatible format, so that you might see for yourself. I
know not what else to do.

"Dave Peterson" wrote:

I haven't seen xl2007, but did you follow the short course and copy that UDF
into a General module?

apprentice idiot wrote:

PPS: WHen I tried the MACRO as entered, I received the message: "No RETURN()
or HALT() function found on Macro Sheet". Please advise further.

"Dave Peterson" wrote:

Can you use a macro?

Are you using xl2k or higher?

If yes to both, you could use a little user defined function like:

Option Explicit
Function ReverseString(myStr As String) As String
ReverseString = StrReverse(myStr)
End Function

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

=======

Short course:
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there.

Now go back to excel to test it out.

Put something like:
=reversestring(a1)
in an adjacent cell

Then copy this down the column and sort your data using this key.

apprentice idiot wrote:

I'd like to sort a row of columns wherein each cell would be sorted
alphabetically but in reverse order; i.e. a cell with the word MICROSOFT
would be sorted as "TFOSORCIM", and one with EXCEL would be sorted as "LECXE"
(This to get groupings of words by their endings: e.g., "-ment", "-ation",
"-ity", "-ship", etc.).

--

Dave Peterson


--

Dave Peterson


apprentice idiot

SORT RIGHT-TO-LEFT IN EXCEL
 
PPPPS: DAVE, IT WORKS!
I don't know why, but I decided to start afresh and do it all over again,
saving a new copy in a macro-enabled format. I followed the same steps
exactly; and, for whatever reason, I had the extreme joy of witnessing the
apparition of the words spelled out in mirror fashion. Thanks for bearing
with me.

"Dave Peterson" wrote:

I haven't seen xl2007, but did you follow the short course and copy that UDF
into a General module?

apprentice idiot wrote:

PPS: WHen I tried the MACRO as entered, I received the message: "No RETURN()
or HALT() function found on Macro Sheet". Please advise further.

"Dave Peterson" wrote:

Can you use a macro?

Are you using xl2k or higher?

If yes to both, you could use a little user defined function like:

Option Explicit
Function ReverseString(myStr As String) As String
ReverseString = StrReverse(myStr)
End Function

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

=======

Short course:
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there.

Now go back to excel to test it out.

Put something like:
=reversestring(a1)
in an adjacent cell

Then copy this down the column and sort your data using this key.

apprentice idiot wrote:

I'd like to sort a row of columns wherein each cell would be sorted
alphabetically but in reverse order; i.e. a cell with the word MICROSOFT
would be sorted as "TFOSORCIM", and one with EXCEL would be sorted as "LECXE"
(This to get groupings of words by their endings: e.g., "-ment", "-ation",
"-ity", "-ship", etc.).

--

Dave Peterson


--

Dave Peterson


Dave Peterson

SORT RIGHT-TO-LEFT IN EXCEL
 
xl2007 added a bunch of different excel file formats--with macros, without
macros....

Glad you found the solution.

apprentice idiot wrote:

PPPPS: DAVE, IT WORKS!
I don't know why, but I decided to start afresh and do it all over again,
saving a new copy in a macro-enabled format. I followed the same steps
exactly; and, for whatever reason, I had the extreme joy of witnessing the
apparition of the words spelled out in mirror fashion. Thanks for bearing
with me.

"Dave Peterson" wrote:

I haven't seen xl2007, but did you follow the short course and copy that UDF
into a General module?

apprentice idiot wrote:

PPS: WHen I tried the MACRO as entered, I received the message: "No RETURN()
or HALT() function found on Macro Sheet". Please advise further.

"Dave Peterson" wrote:

Can you use a macro?

Are you using xl2k or higher?

If yes to both, you could use a little user defined function like:

Option Explicit
Function ReverseString(myStr As String) As String
ReverseString = StrReverse(myStr)
End Function

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

=======

Short course:
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there.

Now go back to excel to test it out.

Put something like:
=reversestring(a1)
in an adjacent cell

Then copy this down the column and sort your data using this key.

apprentice idiot wrote:

I'd like to sort a row of columns wherein each cell would be sorted
alphabetically but in reverse order; i.e. a cell with the word MICROSOFT
would be sorted as "TFOSORCIM", and one with EXCEL would be sorted as "LECXE"
(This to get groupings of words by their endings: e.g., "-ment", "-ation",
"-ity", "-ship", etc.).

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

apprentice idiot

SORT RIGHT-TO-LEFT IN EXCEL
 
I'm glad too. Only without your solution, it would have been a long, long row
to hoe.
Perhaps you could offer a solution for DECONCATENATING IN EXCEL2007 in the
same forum.

"Dave Peterson" wrote:

xl2007 added a bunch of different excel file formats--with macros, without
macros....

Glad you found the solution.

apprentice idiot wrote:

PPPPS: DAVE, IT WORKS!
I don't know why, but I decided to start afresh and do it all over again,
saving a new copy in a macro-enabled format. I followed the same steps
exactly; and, for whatever reason, I had the extreme joy of witnessing the
apparition of the words spelled out in mirror fashion. Thanks for bearing
with me.

"Dave Peterson" wrote:

I haven't seen xl2007, but did you follow the short course and copy that UDF
into a General module?

apprentice idiot wrote:

PPS: WHen I tried the MACRO as entered, I received the message: "No RETURN()
or HALT() function found on Macro Sheet". Please advise further.

"Dave Peterson" wrote:

Can you use a macro?

Are you using xl2k or higher?

If yes to both, you could use a little user defined function like:

Option Explicit
Function ReverseString(myStr As String) As String
ReverseString = StrReverse(myStr)
End Function

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

=======

Short course:
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there.

Now go back to excel to test it out.

Put something like:
=reversestring(a1)
in an adjacent cell

Then copy this down the column and sort your data using this key.

apprentice idiot wrote:

I'd like to sort a row of columns wherein each cell would be sorted
alphabetically but in reverse order; i.e. a cell with the word MICROSOFT
would be sorted as "TFOSORCIM", and one with EXCEL would be sorted as "LECXE"
(This to get groupings of words by their endings: e.g., "-ment", "-ation",
"-ity", "-ship", etc.).

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


Dave Peterson

SORT RIGHT-TO-LEFT IN EXCEL
 
You may want to select your column (or a range in a single column), then try
Data|Text to columns.

Depending on your rules for parsing the data, it might work.

apprentice idiot wrote:

I'm glad too. Only without your solution, it would have been a long, long row
to hoe.
Perhaps you could offer a solution for DECONCATENATING IN EXCEL2007 in the
same forum.

"Dave Peterson" wrote:

xl2007 added a bunch of different excel file formats--with macros, without
macros....

Glad you found the solution.

apprentice idiot wrote:

PPPPS: DAVE, IT WORKS!
I don't know why, but I decided to start afresh and do it all over again,
saving a new copy in a macro-enabled format. I followed the same steps
exactly; and, for whatever reason, I had the extreme joy of witnessing the
apparition of the words spelled out in mirror fashion. Thanks for bearing
with me.

"Dave Peterson" wrote:

I haven't seen xl2007, but did you follow the short course and copy that UDF
into a General module?

apprentice idiot wrote:

PPS: WHen I tried the MACRO as entered, I received the message: "No RETURN()
or HALT() function found on Macro Sheet". Please advise further.

"Dave Peterson" wrote:

Can you use a macro?

Are you using xl2k or higher?

If yes to both, you could use a little user defined function like:

Option Explicit
Function ReverseString(myStr As String) As String
ReverseString = StrReverse(myStr)
End Function

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

=======

Short course:
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there.

Now go back to excel to test it out.

Put something like:
=reversestring(a1)
in an adjacent cell

Then copy this down the column and sort your data using this key.

apprentice idiot wrote:

I'd like to sort a row of columns wherein each cell would be sorted
alphabetically but in reverse order; i.e. a cell with the word MICROSOFT
would be sorted as "TFOSORCIM", and one with EXCEL would be sorted as "LECXE"
(This to get groupings of words by their endings: e.g., "-ment", "-ation",
"-ity", "-ship", etc.).

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com