LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default String Comparison Not Returning Expected Result


The comparison is coded thusly:
-------------------------------------------------------------
If .Cells(rowNum_FirstData, mySortCol).Value _
< .Cells(rowNum_LastData_Revised, mySortCol).Value Then...
-------------------------------------------------------------


But it's case-sensitive.

To wit:
------------------------------------------------
?("aaa" < "zzz")
True

?("aaa" < "Zzz")
False

?("aaa, ABN AMRO Bank" < "Yorktown Capital LLC")
False
------------------------------------------------


Basically, I want to determine whether a column is in ascending
or descending order so I can sort it to the opposite order.

My kneejerk is to Dim a couple of strings, uCase the values
in question into them, and then do the comparison on
the Dim-d strings.

Is there a good-right-and-holy path to follow here?
--
PeteCresswell
 
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
Excel Average function not returning expected result gja63 Excel Worksheet Functions 3 August 28th 07 02:06 AM
Average function not returning expected result gja63 Excel Discussion (Misc queries) 4 August 28th 07 12:36 AM
vlookup shows result one cell above the expected result Marie Excel Worksheet Functions 7 November 14th 06 02:52 AM
Using sum(1/countif....) not returning expected result Kent (thanks) Excel Worksheet Functions 10 May 11th 06 04:35 PM
Returning expected dates London Excel Worksheet Functions 1 July 23rd 05 03:31 AM


All times are GMT +1. The time now is 02:44 PM.

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

About Us

"It's about Microsoft Excel"