ªð¦^¦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)

¦^´_ 12# lpk187


    ÁÂÁÂÀ°¦£~§¹¬ü¹B¦æ¡I

TOP

¦^´_ 11# starry1314


    Option Explicit

Sub ¥¨¶°1()
    Dim c As Range, firstAddress$, myColumn%
    With Sheets("¤u§@ªí1")
        Set c = .Rows(3).Find("P.P", LookIn:=xlValues) '´M¨D²Ä¤@­Ó¥Ø¼Ðª«¥ó
            If Not c Is Nothing Then '¦pªGcª«¥ó¤£¬O¬°Nothing®É¡A°õ¦æ
                firstAddress = c.Address '°O¿ý§ä¨ìªº²Ä¤@­Ó¦ì¸m
                myColumn = 1 '³]©wAÄæ
                Do
                     '.Range(.Cells(2, myColumn), .Cells(Rows.Count, c.Column).End(xlUp)).Name = "Print_Area" '
                     .Range(.Cells(Rows.Count, myColumn).End(xlUp), Cells(2, c.Column)).Name = "Print_Area" '³]©w¦C¦L½d³ò¡A¥H³]©w½d³ò¨Ó»¡¡A¨Ò¦p¡G"A1:C5"©M"A5:C1"¬O¤@¼Ëªº·N«ä
                     '¥u¤£¹LAÄæ¥i¥H§ä¨ì³Ì«á¤@¦C¡A©Ò¥H­n¥Î«áªÌ¨Ó³]©w½d³ò
                     .PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False '¦C¦L
                    Set c = .Rows(3).FindNext(c) '´M§ä¤U¤@­Ó¥Ø¼Ðª«
                    myColumn = myColumn + 19 '¤U¤@­Ó­Ó¦ì¸m¬°TÄæ...¦A¨Ó¬OAMÄæ¡A¨Ì¦¹Ãþ±À
                Loop While Not c Is Nothing And c.Address <> firstAddress '·ícªº¦ì§}©M²Ä¤@­Ó¦ì§}¬Û¦P®É¡A¸õ¥X°j°é
            End If
    End With
End Sub

TOP

¦^´_ 9# lpk187


    ¤£¦n·N«ä..¦³ÂI¥dÃö ·sªºµ{¦¡½X

·|¿ï¾Ü©Ò¦³¦C,¥t¥~¥ÎÅܼƭpºâ¦C«á¦A©ñ¤J·|ÅÜ¥u¿ï¨ú³Ì¤W­±¨â¦C
Sub ¥¨¶°()
    Dim c As Range, firstAddress$, myColumn%
    With Sheets("¤u§@ªí1")
        Set c = .Rows(3).Find("P.P", LookIn:=xlValues)
            If Not c Is Nothing Then
                firstAddress = c.Address
                myColumn = 1
                Do
                     .Range(.Cells(2, myColumn), .Cells(Rows.Count, c.Column).End(xlUp)).Name = "Print_Area"
                     .PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False
                    Set c = .Rows(3).FindNext(c)
                    myColumn = myColumn + 19
                Loop While Not c Is Nothing And c.Address <> firstAddress
            End If
    End With
End Sub

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

¥»©«³Ì«á¥Ñ 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

¦^´_ 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

¦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

¦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

¦^´_ 3# lpk187


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

TOP

        ÀR«ä¦Û¦b : ¤Hªº¤ß¦a¬O¤@²¥¥Ð¡A¤g¦a¨S¦³¼½¤U¦nºØ¤l¡A¤]ªø¤£¥X¦nªºªG¹ê¡C -
ªð¦^¦Cªí ¤W¤@¥DÃD