Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If your sort command ignores case then do this
?(ucase("aaa") < ucase("zzz")) "(PeteCresswell)" wrote: 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Per Joel:
If your sort command ignores case then do this ?(ucase("aaa") < ucase("zzz")) Sounds like maybe there's a Sort command argument to tell it whether or not to consider case. I'll take a look. -- PeteCresswell |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Average function not returning expected result | Excel Worksheet Functions | |||
Average function not returning expected result | Excel Discussion (Misc queries) | |||
vlookup shows result one cell above the expected result | Excel Worksheet Functions | |||
Using sum(1/countif....) not returning expected result | Excel Worksheet Functions | |||
Returning expected dates | Excel Worksheet Functions |