Excel VBAsorting不sorting所有列

我的代码是正确sorting数列A数值,也是绑定到列BD但不是列EM是数量值。 所以当我添加一个股票#描述,供应商和零件#都与股票#sorting,但没有任何数量值。 他们只是留在同一行。 我有数据,需要留在sorting股票#直到列X

 Sub Sorting() Dim sht As Worksheet Dim LastRow As Long Dim LastColumn As Long Dim StartCell As Range Set sht = Sheet1 Set StartCell = Range("A9") 'Refresh UsedRange Worksheets("Order Summary").UsedRange 'Find Last Row LastRow = sht.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row 'Select Range sht.Range("A9:A" & LastRow).Select Range("A9:A" & LastRow).Sort _ Key1:=Range("A9"), Header:=xlYes End Sub 

 Sub Sorting() Application.ScreenUpdating = False ActiveSheet.Sort.SortFields.Clear ActiveSheet.Sort.SortFields.Add Key:=Range("A9") ActiveSheet.Sort.SetRange Range("A9:X500") ActiveSheet.Sort.Apply Application.ScreenUpdating = True End Sub