附件下载:
点击下载此附件
Private Sub CommandButton1_Click() '向上
Cells.Select
shourow = Selection.SpecialCells(xlCellTypeVisible).Row
Range("A" & shourow).Select
' Range("A" & shourow) = "当前行号:" & shourow
If shourow < 11 Then
Rows(11 & ":" & 65536).EntireRow.Hidden = True
Exit Sub
Else
KSROW = shourow - 10
Rows(KSROW & ":" & KSROW + 9).EntireRow.Hidden = False
Rows(shourow & ":" & 65536).EntireRow.Hidden = True
End If
If KSROW > 1 Then
Rows(KSROW - 1 & ":" & 1).EntireRow.Hidden = True
End If
End Sub
Private Sub CommandButton2_Click() '向下
Cells.Select
shourow = Selection.SpecialCells(xlCellTypeVisible).Row
Range("A" & shourow).Select
' Range("A" & shourow) = "当前行号:" & shourow
If shourow > 65526 Then
MsgBox "当前可见行行号大于65526,不能向下翻"
Exit Sub
Else
KSROW = shourow + 10
Rows(KSROW & ":" & KSROW + 9).EntireRow.Hidden = False
Rows(shourow + 9 & ":" & 1).EntireRow.Hidden = True
End If
If KSROW < 65526 Then
Rows(KSROW + 10 & ":" & 65536).EntireRow.Hidden = True
End If
End Sub