ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ªí³æ¦C¦L¶W¹L¤@­¶½d³ò,¥i§_¦b¦C¦L®É³æ­¶¥[Á`¼Æ­È?

¦^´_ 6# zhiling
¦]¬°¨C¥x¦Lªí¾÷³]©w¤@­¶¦³´X­Ó Rows ¬O¤£¤@©w
³o¸Ì¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub Ex()
  3.     Dim Msg As String, xi As Integer
  4.     With ActiveSheet
  5.         If Application.CountA(.Range("a1").CurrentRegion) = 0 Then
  6.             MsgBox "½d³ò¤º¨S¦³¸ê®Æ¥i¦L¦C"
  7.             Exit Sub
  8.         End If
  9.         ActiveWindow.View = xlPageBreakPreview
  10.         .PageSetup.PrintArea = .Range("a1").CurrentRegion.Address
  11.         .PageSetup.PrintTitleRows = "$1:$1"
  12.         .PageSetup.LeftFooter = "&14&N ­¶-  &P"
  13.         '­¶§À¥kÃä:   &14-> ¦rÅéSize =14, &N->Á`­¶¼Æ,  &P->²Ä´X­¶
  14.         For xi = 0 To .HPageBreaks.Count
  15.             Msg = "&14 ¤p­p: "                   '&14:  ¦rÅéSize =14
  16.             If xi = 0 Then
  17.                 Msg = Msg & Application.Sum(.Range([b2], .HPageBreaks(1).Location.Cells(0, 2)))
  18.             ElseIf xi > 0 And xi < .HPageBreaks.Count Then
  19.                 Msg = Msg & Application.Sum(.Range(.HPageBreaks(xi).Location.Cells(1, 2), .HPageBreaks(xi + 1).Location.Cells(0, 2)))
  20.                 Msg = Msg & Chr(10) & "²Ö­p: " & Application.Sum(.Range([b2], .HPageBreaks(xi + 1).Location.Cells(0, 2)))
  21.             Else
  22.                 Msg = Msg & Application.Sum(.Range(.HPageBreaks(.HPageBreaks.Count).Location, .[b2].End(xlDown)))
  23.                 Msg = Msg & Chr(10) & "²Ö­p: " & Application.Sum(.Range("B:B"))
  24.             End If
  25.         .PageSetup.RightFooter = Msg                        '­¶§À¥ªÃä:
  26.          .PrintOut From:=xi + 1, To:=xi + 1, Copies:=1      '¤@­¶¤@­¶¦L¦C
  27.         Next
  28.         .DisplayPageBreaks = False                          '¨ú®ø¤À­¶½u
  29.     End With
  30.     ActiveWindow.View = xlNormalView
  31.     MsgBox "¦L¦C §¹¦¨"
  32. End Sub
½Æ»s¥N½X
À³¥Î¦b 3# ÀÉ®× ¦p¹Ïªº¸ê®Æ¤¤

TOP

        ÀR«ä¦Û¦b : §Ú­Ì­n°µ¦nªÀ·|ªºÀô«O¡A¤]­n°µ¦n¤º¤ßªºÀô«O¡C
ªð¦^¦Cªí ¤W¤@¥DÃD