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

[µo°Ý] Ãö©ó¥¨¶°µ{¦¡­×§ï°ÝÃD

[µo°Ý] Ãö©ó¥¨¶°µ{¦¡­×§ï°ÝÃD

¥»©«³Ì«á¥Ñ §Ú¬OÞ± ©ó 2012-11-13 08:21 ½s¿è

¤p©fªºEXCEL¸Ì¦³6­Ó¤u§@ªí¥HA~EºÙ¤§
§Ú¦bªíC³]«ö¶s,ÂIÀ»«á,·|¨ìªíB´M§äQÄ檺³Ì«á¤@¦C(¸ê®Æ¼ÆÅܰʪº ©Ò¥H³Ì«á¤@¦C¤£©T©w)
¿z¿ïPÄ欰ªÅ®æªº,±NCÄæ½Æ»s¶K¤WªíAªºA3¥H¦¹Ãþ±À..µ{¦¡¦p¤U:
  1. Sub «ö¤U«ö¶s()
  2. Dim y&
  3. With Sheets("B")
  4. y = .[Q65536].End(xlUp).Row ¡@ 'QÄæ³Ì«á¤@¦C
  5.        .Range("P2:P" & y).AutoFilter field:=1, Criteria1:="="
  6.        .Range("C2:C" & y).Copy Sheets("C").[A2]¡@ '¶KCÄæ
  7.        .Range("A2:B" & y).Copy Sheets("C").[B2]¡@ '¶KA~BÄæ
  8.        .Range("D2:H" & y).Copy Sheets("C").[D2]¡@ '¶KD~HÄæ
  9.        .Range("Q2:Q" & y).Copy Sheets("C").[I2]¡@ '¶KQÄæ
  10.        .AutoFilterMode = False¡@ '¨ú®ø¿z¿ï
  11. End With
  12. End Sub
½Æ»s¥N½X
¤p©f±N«ö¶s²¾¦ÜªíB(·Q¦bªíB¤u§@§Y¥i ¤£¥Î¤@ª½¤Á´«)µ{¦¡¤@¼Ë¥Î¤W­z¤º®e
¦ý¶K¤W«áªíCªº®æ½u·|§ïÅÜ,©Ò¦³ªº¤u§@ªí³£¦³©T©wªºªí®æ,¥u·Q¶K¤WÀx¦s®æªº¤º®e¤£­n§ïÅܤu§@ªíªº®æ¦¡,Äæ¼e¦C°ª¦r«¬®Ø½uÃC¦â...µ¥
¸Ó¦p¦ó³]©w?
§Ú·Q¦b¨ú®øªíB¿z¿ï«á±Æ§ÇªíCªºAÄæ¸Ó¦p¦ó¼g¤Jµ{¦¡?
±N©R¥O«ö¶s±qªíC²¾¦ÜªíB¤W­zµ{¦¡¦³»Ý­n­×§ïªº¦a¤è¶Ü?

¦^´_ 1# §Ú¬OÞ±
  1. Sub Test()
  2.     With Sheets("Sheet1")
  3.         ' .Range("A2:E2").Copy Sheets("Sheet2").[F2]
  4.         .Range("B1:B5").Copy Sheets("Sheet2").[G2]
  5.     End With
  6. End Sub

  7. Sub Test2()
  8.     With Sheets("Sheet1")
  9.         ' Sheets("Sheet2").[F5].Resize(, 5) = .Range("A5:E5").Value
  10.         ' Sheets("Sheet2").[F5].Resize(, 5) = .[A5:E5].Value
  11.         Sheets("Sheet2").[F5].Resize(5, 1) = .[B1:B5].Value
  12.     End With
  13. End Sub
½Æ»s¥N½X
Test() ·|³s¦P­I´º¤@¨Ö½Æ»s¹L¨Ó.

TOP

¦^´_ 2# c_c_lai


    ÁÂÁ¤j¤j,¦ý¬O§Ú¥u­n½Æ»s­È ¤£­n³s¦P½Æ»s®æ¦¡,TEXTÀ³¸Ó¤£¾A¥Î^^¤£¹LÁÙ¬OÁÂÁ¤j¤jªºÀ°¦£
    ¥Ñ©ó§Úªº¸ê®Æ¬°ÅÜ¼Æ ³o­Ó¤ë¬°85µ§,¤U­Ó¤ë¥i¯à­°¦Ü45µ§ ©Ò¥H§Úªºµ{¦¡¤º®e­n¥ý§ä¨ì³Ì«á¤@¦C
    ³]Y,µM«á¦A±a¤J¤½¦¡

TOP

¦^´_ 3# §Ú¬OÞ±
¥H¤U¬O¥u¶K¤W­È , ¤£§t®æ¦¡
­n¦A±Æ§ÇªíCªºAÄæ , ­n¥ýª¾¹DAÄæ¹ê»Ú¸ê®Æ¬O¤å¦r/¼Æ¦r? ­n°µ¤É§Ç/­°§Ç? ¤Î¼ÐÃD¦C¬O¦b¦C1 or ¦C2?
  1. Sub «ö¤U«ö¶s()
  2.     Dim y&
  3.     With Sheets("B")
  4.         y = .[Q65536].End(xlUp).Row    'QÄæ³Ì«á¤@¦C
  5.         .Range("P2:P" & y).AutoFilter field:=1, Criteria1:="="
  6.         
  7.         '½Æ»s¸ê®Æ
  8.         Union(.Range("C2:C" & y), .Range("A2:B" & y), .Range("D2:H" & y), .Range("Q2:Q" & y)).Copy
  9.         '¶K¤W­È
  10.         Sheets("C").[A2].PasteSpecial Paste:=xlPasteValues
  11.       
  12.         .AutoFilterMode = False   '¨ú®ø¿z¿ï
  13.     End With
  14. End Sub
½Æ»s¥N½X

TOP

¦^´_ 4# stillfish00

ÁÂÁ¤j¤j,cªíªºAÄ欰¤å¦r,¼ÐÃD¦C¦b¦C1,¨º³o¼ËÀ³¸Ó«ç»ò¼g?

TOP

¦^´_ 4# stillfish00


    ¯u¬O©êºp¤w¸g¶W¹L3¤ÀÄÁ,©Ò¥H¥u¯à¦^´_²Ä¤G¦¸,³Ì¤W­±ªºµ{¦¡§Ú¦³¼g¿ù,¦]¬°ªíC«á¨Ó±N«ö¶s²¾¦ÜªíB©Ò¥H¸ê®Æ±q
    A2¶}©l¼ÐÃD¦C¬°A1~I1 ©Ò¥H³Ì¤W­±½Æ»s¶K¤WªºÀ³¸Ó¬°[A1]¤~¹ï~¦Ü©ó¤j¤j»¡ªº±Æ§Ç ¦]¬°¬O¤å¦r©Ò¥H¤É­°¨Ã¨S¦³¤Ó¤jªº®t§O
    ¥D­n¬O­n±N¬Û¦Pªº¸ê®Æ±Æ¦b¤@°_,¦nÅý§Ú°µ¤U¤@­Ó¤u§@ªí

TOP

¦^´_ 6# §Ú¬OÞ±
®Ú¾Ú1#±Ô­z¼g¤Jªº¥Ø¼Ð¤u§@ªí¬O¤u§@ªíA¡A¦ýµ{¦¡½X«o¬O¼g¤J¨ì¤u§@ªíC
¥H¤Uµ{¦¡½X¬O¨Ì¾Ú1#±Ô­z¤£¹ï¤u§@ªíB¶i¦æ¿z¿ï°Ê§@¡A
ª½±µ±NPÄæªÅ®æ¼g¤J¤u§@ªíA¡A(¼g¤J¥Ø¼Ð¦ì¸m¥i¦Û¦æ°Ñ¦Ò§ó§ï)
  1. Sub Input_Data()
  2. Dim Rng As Range
  3. With Sheets("B") '¤u§@ªíB(¸ê®Æ°Ï)
  4.   r = .[Q65536].End(xlUp).Row
  5.   If Application.CountBlank(.Range("P2:P" & r)) > 0 Then 'PÄæªÅ®æ¼Æ¶q¤j©ó0
  6.      Set Rng = .Range("P2:P" & r).SpecialCells(xlCellTypeBlanks) '§ä¨ìPÄæªÅ®æ
  7.      ad = Split(Replace(Rng.Address(0, 0), "P", ""), ",") '¨ú±oªÅ®æªº¦C¦ì
  8.      ar = Array(3, 1, 2, 4, 5, 6, 7, 8, 17) '¼g¤JªºÄæ¦ì¶¶§Ç
  9.      ReDim ay(UBound(ad) + 1, UBound(ar) + 1)
  10.      For j = 0 To UBound(ad)
  11.         For i = 0 To 8
  12.            ay(j, i) = .Cells(ad(j), ar(i)).Value '±N¸ê®Æ¼È¦s°}¦C¤¤
  13.         Next
  14.      Next
  15.   End If
  16. End With
  17. With Sheets("A") '¼g¤Jªº¤u§@ªí
  18.    With .[A3].Resize(j, i)
  19.      .Value = ay '±N°}¦C¼g¤J¥Ø¼Ð°Ï
  20.      .Sort key1:=.Cells(1, 1) 'AÄæ±Æ§Ç
  21.    End With
  22. End With
  23. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 7# Hsieh
ÁÂÁ¤j¤j,¤j¤j¥i¯à¬Ý¿ù¤F~§Ú±Ô­z¬OB¤u§@ªí¬°³øªí,C¤u§@ªí¬°¿z¿ïbªí©Ò¿ï¨úªº¸ê®Æ¶K¤W
¦ý¬O¤j¤j¦³¼Ð¥Ü¥X¤u§@ªí¥i¥N´«,©Ò¥H¬O¨S¦³°ÝÃDªº^^¥u¬O¸ÑÄÀ¤@¤U!·P®¦¤j¤jªºÀ°¦£­ò,§Ú¥ß¨è¸Õ¸Õ¬Ý¦pªG¦³°ÝÃD¦A¦^´_¤j¤j!!

TOP

¥»©«³Ì«á¥Ñ §Ú¬OÞ± ©ó 2012-11-23 21:10 ½s¿è

¦^´_ 8# Hsieh
¤j¤j§Ú±Nµ{¦¡¼g¤J«ö¶s¥¨¶°¸Ì°õ¦æ®É
ay(j, i) = .Cells(ad(j), ar(i)).Value '±N¸ê®Æ¼È¦s°}¦C¤¤
³o¦æ»¡¸ê®Æ«¬ºA¤£²Å,½Ð°Ý¤@¤U¬O¬Æ»ò­ì¦]©O???

TOP

¦^´_ 9# §Ú¬OÞ±
¾Ç²ß¤¤ , ¬Ý°_¨ÓÀ³¸Ó¬O¤U­±³o¦æªº°ÝÃD
    ad = Split(Replace(Rng.Address(0, 0), "P", ""), ",") '¨ú±oªÅ®æªº¦C¦ì
¦pªGRng¤¤¦³³sÄòªºÀx¦s®æ , Address·|¥H ":" ¦X°_¨Ó , ¤£·|¤@­Ó­Ó³r¸¹¤À¹jªí¥Ü
¸Õ¸Õ¬Ý§â¤W­±¨º¦æ§ï¬°©³¤Uªºcode:
         ReDim ad(Rng.Count - 1)
         k = 0
         For Each area In Rng.Areas
            For Each acell In area
                ad(k) = acell.Row
                k = k + 1
            Next
         Next
©ÎªÌ¬Ý§O¤H¦³¨S¦³§ó²¼äªº¼gªk

TOP

        ÀR«ä¦Û¦b : ºw¤ô¦¨ªe¡C²É¦Ì¦¨ÅÚ¡A¤Å»´¤vÆF¡A¤Å¥Hµ½¤p¦Ó¤£¬°¡C
ªð¦^¦Cªí ¤W¤@¥DÃD