|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Const rowsCnt As Integer = 10
- Const timeCnt As Integer = 1
- Sub Reset()
- Sheet1.Range("A1").Value = False
- Sheet1.Range("B3").Value = 1
- End Sub
- Sub cStop()
- Sheet1.Range("A1").Value = False
- End Sub
- Sub cStart()
- Sheet1.Range("A1").Value = True
- Call ScrollData
- End Sub
- Sub ScrollData()
- With Sheet1
- '更新数据,代码根据实际情况处理
- r = .Range("B3").Value + rowsCnt
- If r > Sheet2.UsedRange.Rows.Count Then
- .Range("B3").Value = 1
- Else
- .Range("B3").Value = r
- End If
- '定时执行下一次滚动
- If .Range("A1").Value Then
- Application.OnTime Now + VBA.TimeSerial(0, 0, timeCnt), "ScrollData"
- End If
- End With
- End Sub
复制代码 |
|