- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 249
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-17
|
¥»©«³Ì«á¥Ñ Hsieh ©ó 2010-8-31 00:14 ½s¿è
¦^´_ 13# olisun
²Öp°Ï¶ôpºâ- Sub ²Öp()
- Dim d as Object,sh as WorkSheet,r as Long,a as Range,w As String,dt As Date,b As Range,at As String
- Set d = CreateObject("Scripting.Dictionary") '«Ø¥ß¦r¨åª«¥ó
- For Each sh In Sheets(Array("¬£§¨³ø«Å¶Ç¨®", "NP¡BCF")) '¦b2Ó¸ê®Æ¤u§@ªí´`Àô
- With sh
- r = 3
- dt = .Cells(r, 1) '¸ê®Æ¤u§@ªíAÄ檺¤é´Á
- Do Until dt > Sheets("¤é³øªí").[E2] '·í¤é´Á¶W¹L´N¸õÂ÷°j°é
- For Each a In .Range(.[B2], .[B2].End(xlToRight)) '¸ê®Æ¤u§@ªí²Ä2¦C°µ´`Àô
- w = a.Offset(-1, 0).MergeArea.Cells(1, 1) '²Ä¤@¦C¹ïÀ³¨ìªº¤º®e¦]¬°¦³¦X¨ÖÀx¦s®æ©Ò¥H¨ú¦X¨Ö½d³ò²Ä¤@®æªºÈ¼g¤JÅܼÆ
- d(w & a) = d(w & a) + .Cells(r, a.Column).Value '¥HºØÃþ¸ò°Ï°ì¦r¦ê°µ¯Á¤ÞÀx¦s¹ïÀ³¨ìªºÈ
- Next
- r = r + 1
- dt = .Cells(r, 1) '¼g¤J¤U¤@Ó¤é´Á
- Loop
- End With
- Next
- With Sheets("¤é³øªí")
- For Each a In .[B15:B26]
- at = a
- For Each b In .[P14:U14]
- If b.Column > 18 Then at = "" '¦]¬°18Äæ¥H«á¨S¦³¦a°Ï©Ò¥HnÅý¦a°ÏÅܼÆÅܪÅ
- .Cells(a.Row, b.Column) = d(b & at) '¼g¦^¤é³øªí
- Next
- Next
- End With
- End Sub
½Æ»s¥N½X |
|