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

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

¥»©«³Ì«á¥Ñ register313 ©ó 2012-6-3 23:17 ½s¿è

¦^´_ 1# zhiling
¤À­¶¤p­p²Ö­p.rar (14.23 KB)
  1. Private Sub CommandButton1_Click()
  2. N = 10
  3. CommandButton2_Click
  4. ResetAllPageBreaks
  5. r = [A65536].End(xlUp).Row
  6. If r Mod N <> 0 Then m = r \ N + 1
  7. For i = m To 1 Step -1
  8.   k = i * N + 2
  9.   Rows(k & ":" & k + 1).Insert Shift:=xlDown
  10.   Cells(k, 1) = "¤p­p"
  11.   Cells(k + 1, 1) = "²Ö­p"
  12.   Cells(k, 2) = Application.Sum(Range(Cells(k - N, 2), Cells(k - 1, 2)))
  13.   Cells(k + 1, 2) = Application.Sum(Range(Cells(3, 2), Cells(k - 1, 2)))
  14.   HPageBreaks.Add Before:=Range("A" & k + 2)
  15. Next i
  16. r = [A65536].End(xlUp).Row
  17. PageSetup.PrintTitleRows = Rows("1:2").Address
  18. PageSetup.PrintArea = "$A$2:$B$" & r
  19. End Sub

  20. Private Sub CommandButton2_Click()
  21. Dim Rng As Range
  22. r = [A65536].End(xlUp).Row
  23. For i = r To 1 Step -1
  24.   If Cells(i, 1) = "¤p­p" Or Cells(i, 1) = "²Ö­p" Then
  25.     If Rng Is Nothing Then
  26.       Set Rng = Rows(i)
  27.     Else
  28.       Set Rng = Union(Rng, Rows(i))
  29.     End If
  30.   End If
  31. Next i
  32. If Not Rng Is Nothing Then Rng.Delete
  33. End Sub
½Æ»s¥N½X
  1. Private Sub CommandButton1_Click()               '¥[¤J¤À­¶¤p­p²Ö­p
  2. N = 10                                           '³]©w10µ§¸ê®Æ¤@­¶
  3. CommandButton2_Click
  4. ResetAllPageBreaks                               '­«³]©Ò¦³¤À­¶½u
  5. r = [A65536].End(xlUp).Row
  6. If r Mod N <> 0 Then m = r \ N + 1               '¦@¦³´X­Ó20ªº­¿¼Æ
  7. For i = m To 1 Step -1
  8.   k = i * N + 2
  9.   Rows(k & ":" & k + 1).Insert Shift:=xlDown     '¥[¤J2¦CªÅ¥Õ¦C
  10.   Cells(k, 1) = "¤p­p"
  11.   Cells(k + 1, 1) = "²Ö­p"
  12.   Cells(k, 2) = Application.Sum(Range(Cells(k - N, 2), Cells(k - 1, 2)))  '¤p­p
  13.   Cells(k + 1, 2) = Application.Sum(Range(Cells(3, 2), Cells(k - 1, 2)))  '²Ö­p
  14.   HPageBreaks.Add Before:=Range("A" & k + 2)     '¤ô¥­¤À­¶½u
  15. Next i
  16. r = [A65536].End(xlUp).Row
  17. PageSetup.PrintTitleRows = Rows("1:2").Address   '³]©w¼ÐÃD¦C
  18. PageSetup.PrintArea = "$A$2:$B$" & r             '³]©w¦C¦L½d³ò
  19. End Sub

  20. Private Sub CommandButton2_Click()                 '²¾°£¤À­¶¤p­p²Ö­p
  21. Dim Rng As Range
  22. r = [A65536].End(xlUp).Row
  23. For i = r To 1 Step -1
  24.   If Cells(i, 1) = "¤p­p" Or Cells(i, 1) = "²Ö­p" Then
  25.     If Rng Is Nothing Then
  26.       Set Rng = Rows(i)
  27.     Else
  28.       Set Rng = Union(Rng, Rows(i))
  29.     End If
  30.   End If
  31. Next i
  32. If Not Rng Is Nothing Then Rng.Delete
  33. End Sub
½Æ»s¥N½X

TOP

¦^´_ 8# ccp

¤@¯ë¾Þ§@:
®æ¦¡/Àx¦s®æ ¼Æ­È ¤Ä¿ï¤d¤À¦ì

¤u§@ªí¨ç¼Æ:
=TEXT(¼Æ­È,"0,000")

VBA:
Format(¼Æ­È, "0,000")

TOP

        ÀR«ä¦Û¦b : ¦h°µ¦h±o¡C¤Ö°µ¦h¥¢¡C
ªð¦^¦Cªí ¤W¤@¥DÃD