- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 277
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-12-23
|
¦^´_ 5# sax868 - Sub ex()
-
- Dim A As Range
-
- Set d = CreateObject("Scripting.Dictionary")
-
- With Sheet2 'Size
-
- For Each A In .Range(.[A2], .Cells(.Rows.Count, 1)).SpecialCells(xlCellTypeConstants)
-
- d(A & A.Offset(, 2)) = A.Offset(, 3).Value
-
- Next
-
- With Sheet3 'Color
-
- For Each A In .Range(.[A2], .Cells(.Rows.Count, 1)).SpecialCells(xlCellTypeConstants)
-
- d(A & A.Offset(, 2)) = A.Offset(, 3).Value
-
- Next
-
- With Sheet1 'Original
-
- For Each A In .Range(.[G2], .Cells(.Rows.Count, 7)).SpecialCells(xlCellTypeConstants)
-
- ar = Split(Replace(A.Offset(, 1), " ", ""), ",") 'Color
-
- ay = Split(Replace(A.Offset(, 3), " ", ""), ",") 'Size
-
- For i = 0 To UBound(ar)
-
- y = y + d(Left(A, 7) & ar(i))
-
- Next
-
- For i = 0 To UBound(ay)
-
- x = x + d(Left(A, 7) & Split(ay(i), "-")(0))
-
- Next
-
-
-
- A.Offset(, 8) = A & A.Offset(, -1)
-
- A.Offset(, 9).Resize(, 2) = Array(Format(y, "#.##%"), Format(x, "#.##%"))
-
- x = 0: y = 0
-
- Next
-
- End With
-
- End With
-
- End With
-
- End Sub
½Æ»s¥N½X ¤£²M·¡²Ä5Ó°ÝÃD¦b´yz¬Æ»ò? |
|