以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]表B行排序  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=153870)

--  作者:miaoqingqing
--  发布时间:2020/8/26 10:37:00
--  [求助]表B行排序
求助   表B编号列行排序,按表A编号列行的顺序排序后保存

表B  编号列
123
231
311

表A
231
311
123

想实现快速批量行排序并保存

[此贴子已经被作者于2020/8/26 10:46:55编辑过]

--  作者:有点蓝
--  发布时间:2020/8/26 10:52:00
--  
For Each r As Row In Tables("表A").Rows
    Dim idx As Integer = Tables("表B").FindRow("编号列=\'" & r("编号列") & "\'")
    If idx > -1 Then
        Tables("表B").Rows(idx)("_sortkey") = r("_sortkey")
    End If
Next