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

[µo°Ý] Ãö©ó¤£©T©wÄæ ¦Û°Ê¦C¦L¦Ü³Ì«á¤@µ§¸ê®Æ

[µo°Ý] Ãö©ó¤£©T©wÄæ ¦Û°Ê¦C¦L¦Ü³Ì«á¤@µ§¸ê®Æ

¥»©«³Ì«á¥Ñ starry1314 ©ó 2016-4-24 19:32 ½s¿è

½Ð°Ý¦p¦ó±qÃþ§O(A2)¿ï¾Ü¥k¤âÃä²Ä¤@­ÓP.P¦ì¸m«á©¹¤U³Ì«á¤@µ§¸ê®Æ,¨Ã¦C¦L

¦]Äæ¦ì¤£©T©w¥B¼ÐÃD·|¦³ªÅ¥Õ,¤£¹LªÅ¥Õ®æ¨ì®É·|ÁôÂÃ

¦b±qÃþ§O(T2) ©¹¥k¦ÜP.PÄ橹¤U³Ì«á¤@µ§¸ê®Æ¨Ã¦C¦L

­ì¹w­p¨Ï¥Î MATCH¨ú±oP.P©Ò¦bÄæ¼Æ
¦ý·f°trange¿ï¾ÜÄæ¼Æ®É·|Åܦ¨¿ï¾ãÄæ,¨Ï¥Îctrl+shift©¹¤Wªº«ü¥O¤]¤£·|¨ì³Ì«á¤@µ§¸ê®Æ,¤Ï¦Ó¤â°Ê«ö½T·|¿ï¾Ü
¦Û°Ê¦C¦L.rar (27.76 KB)

¦^´_ 1# starry1314


    µ¹§A°Ñ¦Ò¡A§Úªº°µªk
  1. Option Explicit

  2. Sub ¥¨¶°1()
  3.     Dim c As Range
  4.     With Sheets("¤u§@ªí1")
  5.         Set c = .Rows(3).Find("P.P", , , , , 1)
  6.         .PageSetup.PrintArea = "$A$2:" & .Cells(Rows.Count, c.Column).End(xlUp).Address '³]©w¦C¦L½d³ò
  7.         .PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False '¦C¦L
  8.         Set c = Nothing
  9.         Set c = .Rows(3).Find("P.P", , , , , 2)
  10.         .PageSetup.PrintArea = "$T$2:" & .Cells(Rows.Count, c.Column).End(xlUp).Address
  11.         .PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False '¦C¦L
  12.         Set c = Nothing
  13.     End With
  14. End Sub
½Æ»s¥N½X

TOP

¦^´_ 1# starry1314


    ¤]¥i¥H³o¼Ë¡I
  1. Option Explicit

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

TOP

¦^´_ 3# lpk187


    ¹ê¦b¤Ó·PÁ¤F,find ¯u¦n¥Î

TOP

¦^´_ 3# lpk187


    ­è§ï¤F¤U¥Î¦b¿z¿ï¤è­±,¥þ¦Û°Ê¤F....ÀH¼ÐÃDªº§ïÅܦۤv§ä¬O²Ä´XÄæ«á¦A¶i¦æ¿z¿ï«á¥t¦s
¤S¥i¥H¦h°½Ãi¤F

TOP

¦pªG¥u¬O³]©w¦C¦L½d³ò,
.PageSetup.PrintArea = "$A$2:" & .Cells(Rows.Count, c.Column).End(xlUp).Address
¤]¥i¥Î:
Range(.[A2], .Cells(Rows.Count, c.Column).End(xlUp)).Name = "Print_Area"

¬Û¹ï³t«×¸û§Ö!!!

TOP

¦pªG¥u¬O³]©w¦C¦L½d³ò,
.PageSetup.PrintArea = "$A$2:" & .Cells(Rows.Count, c.Column).End(xlUp).Addre ...
­ã´£³¡ªL µoªí©ó 2016-4-26 11:43



    ·PÁ±оǡI¡I

TOP

¦^´_ 3# lpk187
¦^´_ 6#

    Set c = .Rows(3).Find("P.P", , , , , 1) '©¹«á´M§ä
·Q½Ð°Ý¯à§_¤£­n©¹«e©¹«á ¥i¿ï¾Ü§ä¨ìªº²Ä´X­Ó  ¥Ø«e¹J¨ì¦P¤@±i¦³¤T±iªí,

¥Ø«e¥u¯à¥ý±N«á¨â­ÓªíªºP.P°µÂI§ïÅÜ

TOP

¥»©«³Ì«á¥Ñ lpk187 ©ó 2016-4-26 20:42 ½s¿è

¦^´_ 8# starry1314

¦b¦¹¥ý·PÁ­㴣³¡ªL¤j¤j±Ð±Âªº"Print_Area"»yªk

    §Q¥ÎRange.Find»¡©ú½d¨Ò­×§ï¤@¤U¡A¥i¥H¹F¨ì§Aªº­n¨D¡A´N¬O¦A§Q¥ÎFindNext
  1. Sub ¥¨¶°1()
  2.     Dim c As Range, firstAddress$, myColumn%
  3.     With Sheets("¤u§@ªí1")
  4.         Set c = .Rows(3).Find("P.P", LookIn:=xlValues)
  5.             If Not c Is Nothing Then
  6.                 firstAddress = c.Address
  7.                 myColumn = 1
  8.                 Do
  9.                      .Range(.Cells(2, myColumn), .Cells(Rows.Count, c.Column).End(xlUp)).Name = "Print_Area"
  10.                      .PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False
  11.                     Set c = .Rows(3).FindNext(c)
  12.                     myColumn = myColumn + 19
  13.                 Loop While Not c Is Nothing And c.Address <> firstAddress
  14.             End If
  15.     End With
  16. End Sub
½Æ»s¥N½X

TOP

¦^´_  starry1314

¦b¦¹¥ý·PÁ­㴣³¡ªL¤j¤j±Ð±Âªº"rint_Area"»yªk

    §Q¥ÎRange.Find»¡©ú½d¨Ò­×§ï¤@ ...
lpk187 µoªí©ó 2016-4-26 20:38


·PÁÂ...­n¬ã¨s¤@¤U ¤ñ¤W¤@­Ó½ÆÂø¤F....

TOP

        ÀR«ä¦Û¦b : ¥Ç¿ù¥XÄb®¬¤ß¡A¤~¯à²M²bµL·Ð´o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD