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

[µo°Ý] ¦Û°Ê´`Àô¦C¦L_§PÂ_¦C¦L½d³ò

[µo°Ý] ¦Û°Ê´`Àô¦C¦L_§PÂ_¦C¦L½d³ò

¥»©«³Ì«á¥Ñ starry1314 ©ó 2016-12-6 10:03 ½s¿è

¼Ï¯Ã¤ÀªRªí
½Ð°ÝVBA¸Ó¦p¦ó³]©w ¦Û°Ê¿ï¾Ü¦C¦L½d³ò«á¦C¦L
1.¤À¦¨¤T±i 1F¡B2F¡B3F
2.¥Ø«e·Qªk¬OA2¶}©l¨ì¤U¤@¦C ¨Ã¥]§t¦X­p¨â¦rªº¦C ¬°¦C¦L½d³ò
3.¦b±q¤W¦¸¹B¦æµ²ªGªº¤U¤@¦C­«½Æ´`Àô..
¦Û°Ê´`Àô¦C¦L_§PÂ_¦C¦L½d³ò.rar (10.68 KB)



¦¹¬°¾î¦Vªº¤è¦¡
  1. Option Explicit
  2. 'LPK87 ´£¨Ñ
  3. Sub ¥¨¶°1()
  4.     Dim c As Range
  5.     With Sheets("¤u§@ªí1")
  6.         Set c = .Rows(3).Find("P.P", , , , , 1) '©¹«á´M§ä
  7.         .PageSetup.PrintArea = .Range(.Cells(Rows.Count, 1).End(xlUp), Cells(2, c.Column)).Address '³]©w¦C¦L½d³ò
  8.         .PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False '¦C¦L
  9.         Set c = Nothing
  10.         Set c = .Rows(3).Find("P.P", , , , , 2) '©¹«e´M§ä
  11.         .PageSetup.PrintArea = .Range(.Cells(Rows.Count, 1).End(xlUp), Cells(2, c.Column)).Address '³]©w¦C¦L½d³ò
  12.         .PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False '¦C¦L
  13.         Set c = Nothing
  14.     End With
  15. End Sub
½Æ»s¥N½X

¦^´_ 5# ­ã´£³¡ªL


    ·PÁ²a¤j

TOP

Sub TEST()
ActiveSheet.ResetAllPageBreaks
For i = 2 To Cells(Rows.Count, 1).End(xlUp).Row - 1
¡@¡@If Right(Cells(i, 1), 2) = "¦X­p" Then
¡@¡@¡@¡@ActiveSheet.HPageBreaks.Add Before:=Cells(i + 1, 1)
¡@¡@End If
Next i
End Sub

¥[¤J¡e¤À­¶¡f½u¡A¦A¤â°Ê¦C¦L¡]¥i¤â°Ê«ü©w¦C¦L­¶¦¸¡^

TOP

¦^´_ 3# starry1314

®Ú¾Ú§A´£¨Ñªº¸ê®Æ¥Îstep2¬O¨S¦³¿ùªº

TOP

¦^´_ 2# ¸­°ê¬w


    ©êºp,½d¨Ò¤£°÷§¹¾ã
¦]«~¶µ¤£¬O©T©wªº ¬GµLªk¨Ï¥Îstep 2
¥i¯à¬ü¦¡1X¶µ ¤é¦¡5¶µ¤§Ãþªº

TOP

  1. Sub test()
  2. For i = 2 To 6 Step 2
  3. Range(Cells(i, 1), Cells(i + 1, 5)).PrintOut
  4. Next i
  5. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¡i®É¶¡¦¨´N¤@¤Á¡j®É¶¡¥i¥H³y´N¤H®æ¡A¥i¥H¦¨´N¨Æ·~¡A¤]¥i¥HÀx¿n¥\¼w¡C
ªð¦^¦Cªí ¤W¤@¥DÃD