I have two fields I need to use for sorting a spreadsheet. One field ("B11") is a date field, the other("F11") is a UniqueID that is partially masked; i.e., "xxxx-xx-0001".
I do not believe that my code is sorting ... Upon researching the issue, I believe the data source already sorts the information by date, so I tried just sorting on the masked UID and it did not work.
Does the "masking" prevent the sort from operating on the exposed digits? Should I use a function like Right(...) to obtain just the digits, and then sort on those? Are there any errors in my code?
Thanks for any help!
I do not believe that my code is sorting ... Upon researching the issue, I believe the data source already sorts the information by date, so I tried just sorting on the masked UID and it did not work.
Does the "masking" prevent the sort from operating on the exposed digits? Should I use a function like Right(...) to obtain just the digits, and then sort on those? Are there any errors in my code?
Thanks for any help!
Code:
With newSh2
.Range("A11:Q" & lastrowSh2).Sort Key1:=.Range("B11"), Order1:=xlDescending, _
Key2:=.Range("F11"), Order2:=xlAscending, _
Header:=xlYes
MatchCase = False
Orientation = xlTopToBottom
SortMethod = xlPinYin
End With