excel vba打印时显示超出页面范围怎么弄

只可以打到98行。接下来就点不上了。以下是代码:Private Sub Worksheet_Activate()SpinButton1.Max = Sheets("银行回单数据").Range("B65536").End(xlUp).Row - 2End SubSub dy()ks = Val(Application.InputBox("请输入起始页号"))If ks < 0 Or ks > Sheets("银行回单数据").Range("B65536").End(xlUp).Row - 2 Then MsgBox "超出页面范围" Exit SubEnd Ifjs = Val(Application.InputBox("请输入结束页号"))If js < 0 Or js > Sheets("银行回单数据").Range("B65536").End(xlUp).Row - 2 Or js < ks Then MsgBox "超出页面范围" Exit SubEnd IfFor i = ks To js SpinButton1.Value = i PrintOutNext iEnd Sub

第1个回答  2019-01-03
Sub yy() ''插入式(单元格)
Sheet2.Activate
Dim arr, i&, j&, k&, a, b, c
arr = [a1].CurrentRegion
a = UBound(arr)
b = Application.CountA(Application.Index(arr, 0, 6))
c = a + b
For i = 1 To c
If Len(Cells(i, 6)) Then
Rows(i + 1).Insert
Range("f" & i).Resize(1, 4).Cut: Range("b" & i + 1).Select: ActiveSheet.Paste
i = i + 1
End If
Next
End Sub本回答被网友采纳
第2个回答  2019-01-03
debug去确认一下,到底是哪个位置取值取错了
第3个回答  2019-01-03
嗯,我有完整版,点击我的头像~~
相似回答