Я новичок ie в Excel VBA. Это код, который я нашел на inte rnet и я wi sh, чтобы перевести его в режим работы.
Заранее спасибо за помощь.
Sub PageNumberEnd()
Dim xVPC As Integer
Dim xHPC As Integer
Dim xVPB As VPageBreak
Dim xHPB As HPageBreak
Dim xNumPage As Integer
xHPC = 1
xVPC = 1
If ActiveSheet.PageSetup.Order = xlDownThenOver Then
xHPC = ActiveSheet.HPageBreaks.Count + 1
Else
xVPC = ActiveSheet.VPageBreaks.Count + 1
End If
xNumPage = 1
For Each xVPB In ActiveSheet.VPageBreaks
If xVPB.Location.Column > activecell.Column Then Exit For
xNumPage = xNumPage + xHPC
Next
For Each xHPB In ActiveSheet.HPageBreaks
If xHPB.Location.Row > activecell.Row Then Exit For
xNumPage = xNumPage + xVPC
Next
activecell = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
End Sub