Gruppe
Druck
Problem
Wie kann ich die Druckseite drucken lassen, in der sich aktuell der Cursor befindet?
StandardModule: basMain
Sub PrintActPage()
Dim varPB As Variant
Dim iPage As Integer, iHPage As Integer, iVPage As Integer
Do Until ActiveCell.Row + 1 <= varPB
iHPage = iHPage + 1
varPB = ExecuteExcel4Macro("INDEX(GET.DOCUMENT(64)," & iHPage & ")")
If IsError(varPB) Then Exit Do
Loop
varPB = 0
Do Until IsError(varPB)
iPage = iPage + 1
varPB = ExecuteExcel4Macro("INDEX(GET.DOCUMENT(64)," & iPage & ")")
If IsError(varPB) Then Exit Do
Loop
varPB = 0
Do Until ActiveCell.Column + 1 <= varPB
iVPage = iVPage + 1
varPB = ExecuteExcel4Macro("INDEX(GET.DOCUMENT(65)," & iVPage & ")")
If IsError(varPB) Then Exit Do
Loop
iPage = (iPage * (iVPage - 1)) + iHPage
ActiveSheet.PrintOut from:=iPage, to:=iPage
End Sub