Posted to microsoft.public.excel.worksheet.functions
|
|
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
|