以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  重复填充  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=95277)

--  作者:lk15502
--  发布时间:2017/1/15 8:30:00
--  重复填充
前几天,有人误操作“重复填充”,一下把近5000条数据给填充了,有没有设置重复填充一次只能填充20条一下的数据,请教老师!
--  作者:lk15502
--  发布时间:2017/1/15 8:31:00
--  
20条以下的数据
--  作者:有点色
--  发布时间:2017/1/15 11:27:00
--  

 你通过什么方法填充数据的?贴出你写的代码。


--  作者:lk15502
--  发布时间:2017/1/15 18:03:00
--  
重复填充的代码:syscmd.edit.repeatfill()
--  作者:有点色
--  发布时间:2017/1/15 18:19:00
--  

 你自己写代码替换原来的代码

 


Dim t As Table = CurrentTable
If t.BottomRow - t.TopRow > 20 Then
    msgbox("不能超过20行")
Else
    For j As Integer = t.LeftCol To t.RightCol
        Dim str As String = t.rows(t.TopRow)(j)
        For i As Integer = t.TopRow To t.BottomRow
            t.rows(i)(j) = str
        Next
    Next
End If


--  作者:有点色
--  发布时间:2017/1/15 18:20:00
--  

Dim t As Table = CurrentTable
If t.BottomRow - t.TopRow > 20 Then
    msgbox("不能超过20行")
Else
    syscmd.edit.repeatfill()
End If

--  作者:lk15502
--  发布时间:2017/1/15 18:56:00
--  
老师我写了这样的代码,可以吗?,,还有这三段代码,哪个最可靠?
Dim t As Table = CurrentTable
For i As Integer = t.TopPosition + 1 To t.BottomPosition
    If i <= 20 Then
        t.rows(i)(t.colsel) = t.rows(i-1)(t.ColSel)
    Else
        MessageBox.Show("重复填充不能超过20条数据!")
        i = 20
        t.rows(i)(t.colsel) = t.rows(i-1)(t.ColSel)
        Exit For
    End If
Next

--  作者:lk15502
--  发布时间:2017/1/15 18:58:00
--  
如果加了快捷键,,限制是不是对快捷键也有效?
--  作者:有点色
--  发布时间:2017/1/16 3:44:00
--  
以下是引用lk15502在2017/1/15 18:58:00的发言:
如果加了快捷键,,限制是不是对快捷键也有效?

 

嗯嗯,是的。你的代码可以执行。