AnsweredAssumed Answered

Excel does not sort properly

Question asked by MWichert82 on May 4, 2017
Latest reply on May 11, 2017 by jru

Hallo everybody.

I have a range of values (A2:K85) and I want to sort everything according the values in column "I". In column "G", the cells contain values pulled from the PI-server and filtered according signal -status.

(e.g. =PITimeFilterVal(Sheet1!$E48;Sheet1!$F48;Sheet1!$Q$21;"hours";0;"pi-dait_ar") ). When I run the macro, the values in "G" are not sorted properly and I get a missmatch in the rows. The code I use is the following:

 

Sub OVERDUE()

 

Dim oneRange1 As Range, oneRange2 As Range, oneRange3 As Range

Dim aCell1 As Range, aCell2 As Range, aCell3 As Range

 

Set oneRange1 = Range("A2:K85")

Set aCell1 = Range("I2:I85")

 

oneRange1.Sort Key1:=aCell1, Order1:=xlAscending, Header:=xlYes

 

EndSub.

 

Does anybody see the error ?

Kind regards,

Marcus

Outcomes