- ©«¤l
- 967
- ¥DÃD
- 0
- ºëµØ
- 0
- ¿n¤À
- 1001
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN XP
- ³nÅ骩¥»
- OFFICE 2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-11-29
- ³Ì«áµn¿ý
- 2022-5-17
|
¥»©«³Ì«á¥Ñ register313 ©ó 2012-6-3 23:17 ½s¿è
¦^´_ 1# zhiling
¤À¶¤pp²Öp.rar (14.23 KB)
- Private Sub CommandButton1_Click()
- N = 10
- CommandButton2_Click
- ResetAllPageBreaks
- r = [A65536].End(xlUp).Row
- If r Mod N <> 0 Then m = r \ N + 1
- For i = m To 1 Step -1
- k = i * N + 2
- Rows(k & ":" & k + 1).Insert Shift:=xlDown
- Cells(k, 1) = "¤pp"
- Cells(k + 1, 1) = "²Öp"
- Cells(k, 2) = Application.Sum(Range(Cells(k - N, 2), Cells(k - 1, 2)))
- Cells(k + 1, 2) = Application.Sum(Range(Cells(3, 2), Cells(k - 1, 2)))
- HPageBreaks.Add Before:=Range("A" & k + 2)
- Next i
- r = [A65536].End(xlUp).Row
- PageSetup.PrintTitleRows = Rows("1:2").Address
- PageSetup.PrintArea = "$A$2:$B$" & r
- End Sub
- Private Sub CommandButton2_Click()
- Dim Rng As Range
- r = [A65536].End(xlUp).Row
- For i = r To 1 Step -1
- If Cells(i, 1) = "¤pp" Or Cells(i, 1) = "²Öp" Then
- If Rng Is Nothing Then
- Set Rng = Rows(i)
- Else
- Set Rng = Union(Rng, Rows(i))
- End If
- End If
- Next i
- If Not Rng Is Nothing Then Rng.Delete
- End Sub
½Æ»s¥N½X- Private Sub CommandButton1_Click() '¥[¤J¤À¶¤pp²Öp
- N = 10 '³]©w10µ§¸ê®Æ¤@¶
- CommandButton2_Click
- ResetAllPageBreaks '«³]©Ò¦³¤À¶½u
- r = [A65536].End(xlUp).Row
- If r Mod N <> 0 Then m = r \ N + 1 '¦@¦³´XÓ20ªº¿¼Æ
- For i = m To 1 Step -1
- k = i * N + 2
- Rows(k & ":" & k + 1).Insert Shift:=xlDown '¥[¤J2¦CªÅ¥Õ¦C
- Cells(k, 1) = "¤pp"
- Cells(k + 1, 1) = "²Öp"
- Cells(k, 2) = Application.Sum(Range(Cells(k - N, 2), Cells(k - 1, 2))) '¤pp
- Cells(k + 1, 2) = Application.Sum(Range(Cells(3, 2), Cells(k - 1, 2))) '²Öp
- HPageBreaks.Add Before:=Range("A" & k + 2) '¤ô¥¤À¶½u
- Next i
- r = [A65536].End(xlUp).Row
- PageSetup.PrintTitleRows = Rows("1:2").Address '³]©w¼ÐÃD¦C
- PageSetup.PrintArea = "$A$2:$B$" & r '³]©w¦C¦L½d³ò
- End Sub
- Private Sub CommandButton2_Click() '²¾°£¤À¶¤pp²Öp
- Dim Rng As Range
- r = [A65536].End(xlUp).Row
- For i = r To 1 Step -1
- If Cells(i, 1) = "¤pp" Or Cells(i, 1) = "²Öp" Then
- If Rng Is Nothing Then
- Set Rng = Rows(i)
- Else
- Set Rng = Union(Rng, Rows(i))
- End If
- End If
- Next i
- If Not Rng Is Nothing Then Rng.Delete
- End Sub
½Æ»s¥N½X |
|