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

[µo°Ý] Range'¤èªk('_Global'ª«¥ó)¥¢±Ñ

[µo°Ý] Range'¤èªk('_Global'ª«¥ó)¥¢±Ñ

¤p§Ì¤£¤~...¤§«eµo°Ý¤F³\¦h¥\¯à, ­nµ²¦X¦¨¤@­Óµ{¦¡
µ²ªG¥X½u¦p¼ÐÃD¼Ëªº¿ù»~

¦X¨ÖÀx¦s®æ®É´N·|¥X¿ù...., »¡¤]©_©Ç...²Ä¤@¤Ñ¼¶¼g§¹²¦Try Run ³£¨S°ÝÃD..²Ä¤G¤Ñ´N¥X¿ù¤F


§Ú¥ý»¡©ú¤@¤Uµ{¦¡¦p¦ó¼¶¼g¤ÎÅÞ¿è

¦p¤U¹Ï©Ò¥Ü, ¤À¬°AÀɮץΨӰõ¦æ¥¨¶°,  BÀɮ׬°¸ê®Æ°Ñ¦Ò¨Ó·½ ( ¦]¬°ÀɮצWºÙ¤£¤@©w, ¦ý¤º®e®æ¦¡©T©w )



°õ¦æµ{¦¡¤è¦¡:
1. ¦P®É¥´¶}A, B ÀÉ®× , µ{¦¡¶}©l§PÂ_BÀɮתº¤À­¶3 , ¬ÛÃöÄæ¦ì,§P©w¨S¦³¶}¿ùBÀÉ®×(¸ê®Æ°Ñ¦Ò¨Ó·½)
2. ±NBÀɮ׻ݭnªºÄæ¦ì½Æ»s¨ìAÀɮפº, °Å°Å¶K¶K
3. ¶}©l°w¹ï¤£»Ý­n«O¯dªº§R°£
    3-1. §PÂ_I~TÄæ¦pªGªÅ¥Õ¤]§R°£
4. ±NZÄæ¦ì, ²Ä¤@­Ó¡y-¡z «eªº¸ê®Æ§R°£, «O¯d­nªº¸ê®Æ
5. ¶}©l§PÂ_BÄæ¦ì¡BCÄæ¦ì¡BDÄæ¦ì¡BEÄæ¦ì¡BFÄæ¦ì¡BXÄæ¦ì¡BZÄæ¦ì ¥u­n¬Û¦P´N¦X¨ÖÀx¦s®æ
    (¤U¹ÏÁ|¨Ò¹Ï) ¥X¿ù¤]¦b³o


6. ¤§«á´N¶]¥ý«eµo°Ýªº°ÝÃD   [µo°Ý] ¦p¦ó±NAÄæ¬Û¦Pªº¦r, ´¡¤J·sÄæ¦ì·s¼W¨ìBÄæ¸Ì
7. ½Õ¾ãÄæ¼e
8. ½Õ¾ã¦C¦L³]©w

¡° µ{¦¡°õ¦æ§¹²¦²z·Qª¬ºA¦pAÀɮײĤT­Ó¤À­¶[ENG]  < ¤â°Ê½Õ¾ã§¹¦¨, ¦]¥X¿ùµLªkÅã¥Ü¨º¼Ë >

Q1: ½Ð°Ý¥X¿ùªº³¡¤Àµ{¦¡½X¦p¦ó­×¥¿©O?
¿ù»~³¡¤À
  1. For Each xRR In xArea
  2.     If xRR & xRR(1, 2) <> xRR(0) & xRR(0, 2) Then Set xH = xRR
  3.     If xRR & xRR(1, 2) <> xRR(2) & xRR(2, 2) Then
  4.       Range(xH, xRR).Merge: Range(xH(1, 2), xRR(1, 2)).Merge    'MO
  5.       Range(xH, xRR).Merge: Range(xH(1, 3), xRR(1, 3)).Merge    'PC Code
  6.       Range(xH, xRR).Merge: Range(xH(1, 4), xRR(1, 4)).Merge    'Device
  7.       Range(xH, xRR).Merge: Range(xH(1, 5), xRR(1, 5)).Merge    'Date
  8.       Range(xH, xRR).Merge: Range(xH(1, 24), xRR(1, 24)).Merge  'MO QTY
  9.       Range(xH, xRR).Merge: Range(xH(1, 26), xRR(1, 26)).Merge  ' BD NO
  10.       Range(xH, xRR(1, 26)).Borders.LineStyle = 1
  11.       For i = 7 To 10
  12.           Range(xH, xRR(1, 26)).Borders(i).Weight = xlMedium
  13.       Next i
  14.     End If
  15. Next
½Æ»s¥N½X
Q2: ¥Ø«e¦]¬°¤p§Ì¤Ó²Â, ©Ò¥H¤T­Ó«ö¶s³£¬O­Ó§O¶]¦U¦Û¤À­¶, ¦³¿ìªk¶]¤@¦¸µ{¦¡, ¦Û°Ê¤À¥h¤T­Ó¤À­¶¶Ü?
AÀɮתº¤T­Ó¤À­¶, ³£¬O°Ñ¦ÒBÀɮפÀ­¶3ªº¸ê®Æ
®t²§©ó
AÀɮפÀ­¶2 ¬O­n±N¦p¤U±ø¥ó³£§R°£
  1.      For g = .Range("A65536").End(xlUp).Row To 2 Step -1
  2.         If .Cells(g, "A") Like "BGA*" Or _
  3.            .Cells(g, "C") Like "*CSP-L1*" Or _
  4.            .Cells(g, "C") Like "*L1*" Or _
  5.            .Cells(g, "C") Like "*L2*" Or _
  6.            .Cells(g, "C") Like "*CSP*" Or _
  7.            .Cells(g, "C") Like "*ENG*" Or _
  8.            .Cells(g, "C") Like "*HQ-CSP*" Or _
  9.            .Cells(g, "C") Like "*HQ-L2*" Then
  10.             .Rows(g).Delete
  11.         End If
  12.      Next
½Æ»s¥N½X
AÀɮפÀ­¶3 ¬O¥u­n«O¯d¦p¤U±ø¥ó, ´Á¥L³£§R°£
  1.      For g = .Range("A65536").End(xlUp).Row To 2 Step -1
  2.            If Not .Cells(g, "C") Like "*ENG*" Then
  3.             .Rows(g).Delete
  4.         End If
  5.      Next
½Æ»s¥N½X
AÀɮפÀ­¶4 ¬O¥u­n«O¯d¦p¤U±ø¥ó, ´Á¥L³£§R°£
  1.     For y = .Range("A65536").End(xlUp).Row To 2 Step -1
  2.         If Not .Cells(y, "C") Like "*CSP-L1*" And _
  3.            Not .Cells(y, "C") Like "*L1*" And _
  4.            Not .Cells(y, "C") Like "*L2*" And _
  5.            Not .Cells(y, "C") Like "*CSP*" And _
  6.            Not .Cells(y, "C") Like "*HQ-CSP*" And _
  7.            Not .Cells(y, "C") Like "*HQ-L2*" Then
  8.             .Rows(y).Delete
  9.         End If
  10.      Next
  11. End With
½Æ»s¥N½X
test.rar (656.48 KB)

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2016-4-22 09:18 ½s¿è

¦^´_ 5# v03586
¦^´_ 4# ­ã´£³¡ªL
¥¿¦p­ã´£³¡ªL¤j¤j©Ò¨¥¡A¸g¹ê»Ú´ú¸Õ«á¡A¥¦¬OÃöÁä©Ò¦b¡C
Module1:  Sub ·s³øªí_HQ¶×¤J()
  1. Dim RR&, xArea As Range, xRR As Range, xH As Range, T, TT, XX
  2. RR = [FMC!A65536].End(xlUp).Row: If RR < 3 Then Exit Sub
  3. '  ½Ð±N ("A3:A" & R) ­×§ï¦¨ ("A2:A" & R) §Y¥i¡C
  4. '  Set xArea = Sheets("FMC").Range("A3:A" & R)
  5. Set xArea = Sheets("FMC").Range("A2:A" & R)

  6. For Each xRR In xArea
  7.     T = xRR(1, 26): xRR(1, 26) = Mid(T, InStr(T, "-") + 1)
  8. Next
½Æ»s¥N½X
'  xRR & xRR(1, 2)    : "eMCP SIP162L 11.5*132981180" : Variant/String
    '  xRR(0) & xRR(0, 2) : "eMCP SIP162L 11.5*132981180" : Variant/String
    '  xH                 : Nothing                       : Range
    '  xRR(2) & xRR(2, 2) : "eMCP SIP162L 11.5*132981181" : Variant/String
    '  
    '  °õ¦æ¶¥¬q¿ù»~ '1004':
    '  Range'¤èªk ('_Global'ª«¥ó)¥¢±Ñ
    '  
    '  PKG        MONBR        PCCode        DEVICE        IPT_DATE        DavinciCode
    '  eMCP SIP162L 11.5*13        2981180        KSI-PS-A0419-16        P-PS0703MKP82110EG-NR4GCA2-CTHD08GD1-45        2016/4/20 01:01        R1F60:02
    '  eMCP SIP162L 11.5*13        2981180        KSI-PS-A0419-16        P-PS0703MKP82110EG-NR4GCA2-CTHD08GD1-45        2016/4/20 01:01        B1D25:03
    '  eMCP SIP162L 11.5*13        2981181        KSI-PS-A0419-16        P-PS0703MKP82110EG-NR4GCA2-CTHD08GD1-45        2016/4/20 01:01        R1F60:02

    '  ----------------------------------------------------------------------
    '  B-1.xlsx
    '  xRR & xRR(1, 2)    : "eMCP SIP162L 11.5*132981181" : Variant/String
    '  xRR(0) & xRR(0, 2) : "eMCP SIP162L 11.5*132981180" : Variant/String
    '  xH                 : "eMCP SIP162L 11.5*13"        : Range
    '  xRR(2) & xRR(2, 2) : "eMCP SIP162L 11.5*132981182" : Variant/String
    '   
    '  xRR & xRR(1, 2)    : "eMCP SIP162L 11.5*132981182" : Variant/String
    '  xRR(0) & xRR(0, 2) : "eMCP SIP162L 11.5*132981181" : Variant/String
    '  xH                 : "eMCP SIP162L 11.5*13"        : Range
    '  xRR(2) & xRR(2, 2) : "eMCP SIP162L 11.5*132981182" : Variant/String

    '  PKG        MONBR        PCCode        DEVICE        IPT_DATE        DavinciCode
    '  eMCP SIP162L 11.5*13        2981180        KSI-PS-A0419-16        P-PS0703MKP82110EG-NR4GCA2-CTHD08GD1-45        2016/4/20 01:01        R1F60:02
    '  eMCP SIP162L 11.5*13        2981181        KSI-PS-A0419-16        P-PS0703MKP82110EG-NR4GCA2-CTHD08GD1-45        2016/4/20 01:01        R1F60:02
    '  eMCP SIP162L 11.5*13        2981182        KSI-PS-A0419-16        P-PS0703MKP82110EG-NR4GCA2-CTHD08GD1-45        2016/4/20 01:01        R1F60:02
°ÝÃD¾É·½©ó:
  1. Set xArea = Sheets("FMC").Range("A3:A" & R)
½Æ»s¥N½X

TOP

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


    ·PÁ¤j¤jªºsupport @@ §Úª©¥»¬O¨Ï¥Î2003 ¼¶¼g !!

TOP

¦^´_ 5# v03586

§Úªºª©¥»µLªk´ú§¹¾ãµ{¦¡,
¥i¥ý±NCall testµù¸Ñ±¼¤£°õ¦æ, ¦A¥h§ä°ÝÃD¥X¦b­þ­ÓÀô¸`,
·Ó»¡À³¶]§¹¸ê®Æ«á, ¦A³B²z¼ÐÃD¦C¤W¤èªº¨â¦C!
ª©¥»¤ÓÂÂ,À°¤£¤F¦£!!

TOP

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


    §ï§¹«á²Ä¤@Äæ©ïÀYÄæ¦ì ·|³Q¦X¨Ö¥B¦³¸ê®Æ, ·Pı¬O³Q¦X¨Ö¤F
¦p¤U¹Ï


¤µ¤Ñ¦­¤W¹Á¸Õ, ¥¼­×§ïµ{¦¡½X«e, ¦p¤U¥t¥~¤@¥÷BÀÉ®×( ®æ¦¡³£¨SÅÜ )  , ³ºµMHQ¥i¥H¶]±o¥X¨Ó, ¦ý¨ä¥LENG , ¶Ç²ÎµLªk°õ¦æ, ¯uªº¤£ª¾¹Dµo¥Í¤°»ò¨Æ
B-1.rar (738.45 KB)

TOP

¥»©«³Ì«á¥Ñ ­ã´£³¡ªL ©ó 2016-4-21 10:45 ½s¿è

Set xArea = Sheets("FMC").Range("A3:A" & R)
§ï¬°¡G
Set xArea = Sheets("FMC").Range("A2:A" & R)

¸ê®Æ±q²Ä¢±¦C¶}©l¡ã¡ã
RR = [FMC!A65536].End(xlUp).Row: If RR < 3 Then Exit Sub
RR = [FMC!A65536].End(xlUp).Row: If RR < 2 Then Exit Sub

TOP

¦^´_ 1# v03586
§A¤¤³~«Å§i¤F Dim xH As Range «á¡A
¤@ª½¨ì For Each xRR In xArea ¤§¶¡
¨Ã¥¼µ¹¤©  xH ª«¥ó¥ô¦ó­È (Nothing)¡A
±µµÛ§A¤S«æ«æ¦£¦£¦a¨Ó­Ó "ÅQ¤ýµw¤W¤}"¡A
Range(xH, xRR).Merge
¤£¥X¿ù¤~©Ç¡I
  1. °õ¦æ¶¥¬q¿ù»~ '1004':
  2. 'Range'¤èªk ('_Global'ª«¥ó)¥¢±Ñ
½Æ»s¥N½X

TOP

¦^´_ 1# v03586
µo¥Í¿ù»~®É«ö¤U°»¿ù,
§Y®É¹Bºâµøµ¡¥´¤W
?Xh.Address
»P
?xRR.Address
¬Ý¬ÝÀx¦s®æ¦ì§}¬O§_¥¿½T.

TOP

        ÀR«ä¦Û¦b : ¤p¨Æ¤£°µ¡B¤j¨ÆÃø¦¨¡C
ªð¦^¦Cªí ¤W¤@¥DÃD