|
本帖最后由 goodlaugh 于 2024-7-30 22:29 编辑
如下是一段翻页的VBA代码,我需要每次翻25列,这个代码要修改哪个地方呢?我把代码里的25+1改成25,但运行有问题,谢谢!
Private Sub ComboBox1_Change()
End Sub
Private Sub SpinButton1_Change()
Dim x As Long
x = Val(Replace(Range("A4"), "第", "")) + 1
End Sub
Private Sub SpinButton1_SpinDown()
Dim x As Long
Range("A4") = "第" & Application.Max(Val(Replace(Range("A4"), "第", "")) - 1, 1) & "页"
x = Val(Replace(Range("A4"), "第", ""))
ActiveWindow.ScrollColumn = (x - 1) * 25 + 1
End Sub
Private Sub SpinButton1_SpinUp()
Dim x As Long
Range("A4") = "第" & Val(Replace(Range("A4"), "第", "")) + 1 & "页"
x = Val(Replace(Range("A4"), "第", ""))
ActiveWindow.ScrollColumn = (x - 1) * 25 + 1
End Sub
|
|