kweaver
Well-known Member
- Joined
- May 12, 2009
- Messages
- 2,940
- Office Version
- 365
I have a simple sheet that looks like this:
more data
And, I'm using the following code within other code in VBA:
LRX is 39 in the sample case above.
I want the data to be ordered by DATE (J column), then ordered by the values in the C column, but I'm getting this strange result:
Even when I do the reverse sort keys, I still get a mix up of the data.

more data

And, I'm using the following code within other code in VBA:
Code:
With ActiveSheet.Sort
.SortFields.Add Key:=Range("J1"), Order:=xlAscending
.SortFields.Add Key:=Range("C1"), Order:=xlAscending
.SetRange Range("A1:V" & LRX)
.Header = xlYes
.Apply
End With
LRX is 39 in the sample case above.
I want the data to be ordered by DATE (J column), then ordered by the values in the C column, but I'm getting this strange result:

Even when I do the reverse sort keys, I still get a mix up of the data.

Last edited: