For Each dr As DataRow In DataTables("A表").DataRows
改为:
For Each dr As DataRow In DataTables("A表").Select("","排序列名称")
参考:
http://www.foxtable.com/help/topics/0400.htm