Hallo Bernd,
ich bin nicht sicher, ob ich Dich richtig verstanden habe, aber mal als Ansatz:
Sub Zahl_der_aktuellen_Druckseite()
Application.ScreenUpdating = False
ActiveSheet.PageSetup.PrintArea = ""
y = 1: Z = 1: i = 1: j = 1
eSeite = False: aSeite = False
Do While aSeite = False
Call Aktuelle_Seite
Loop
End Sub
Sub Aktuelle_Seite()
Dim Blatt As Range
Dim Prüfen As Object
Do While eSeite = False
Call Seitenumbruch(i, j)
Set Blatt = Range(Cells(y, Z), Cells(ZB, SB))
Set Prüfen = Application.Intersect(Range(ActiveCell.Address), _
Range(Blatt.Address))
If Prüfen Is Nothing = False Then
ActiveCell = "Aktuelle Druckseiten-Nr. ist " & i
End
End If
y = ZB + 1
i = i + 1
Loop
j = j + 1
Z = SB + 1
i = 1: y = 1
eSeite = False
End Sub
Sub Seitenumbruch(nBlatt, oBlatt)
Dim varPB As Variant
Dim nSeite%
varPB = ExecuteExcel4Macro("INDEX(GET.DOCUMENT(64)," & nBlatt & ")")
If IsError(varPB) Then
ZB = Cells(Cells.Rows.Count, oBlatt).End(xlUp).Row
eSeite = True
Exit Sub
End If
ZB = varPB - 1
varPB = ExecuteExcel4Macro("INDEX(GET.DOCUMENT(65)," & oBlatt & ")")
If IsError(varPB) Then
aSeite = True
SB = Cells(nBlatt, 256).End(xlToLeft).Column
Exit Sub
End If
SB = varPB - 1
End Sub
Gruß
Martin Beck