- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 278
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-12-24
|
¦^´_ 16# tonycho33
ªí®æªº¦X¨ÖÀx¦s®æ°ÝÃD- Sub Âà¸m()
- Dim A As Range, Ar(), Ay(), i%, j%, Ary(), s&
- r = 2
- With Sheets("a")
- Do Until .Cells(r, 1) = ""
- Set A = .Cells(r, 1)
- Ar = A.Resize(, 4)
- k = Application.CountA(.Range(A.Offset(, 6), A.Offset(, 6).End(xlToRight)))
- Ay = A.Offset(, 6).Resize(3, k).Value
- For i = 1 To UBound(Ay, 2)
- ReDim Preserve Ary(7, s)
- Ary(0, s) = Ar(1, 1): Ary(1, s) = Ar(1, 2): Ary(6, s) = Ar(1, 4)
- For j = 1 To UBound(Ay, 1)
- Ary(j + 1, s) = Ay(j, i)
- Next
- s = s + 1
- Next
- r = r + 3
- Loop
- End With
- Sheets("b").UsedRange.Offset(1) = ""
- Sheets("b").[A2].Resize(s, 7) = Application.Transpose(Ary)
- End Sub
- Private Sub Worksheet_Activate()
- Set d = CreateObject("Scripting.Dictionary")
- With Sheet6
- For Each A In .Range("J:J").SpecialCells(xlCellTypeConstants)
- If A = "ok" Then
- mystr = Join(Application.Transpose(Application.Transpose(A.Offset(, -9).Resize(, 5).Value)), "")
- d(mystr) = d.Count
- End If
- Next
- End With
- With Me
- r = 2
- Do Until .Cells(r, 1) = ""
- Set A = .Cells(r, 1)
- mystr = A & A.Offset(, 1)
- For Each c In .Range(A.Offset(, 6), A.Offset(, 6).End(xlToRight))
- temp = mystr & Join(Application.Transpose(c.Resize(3, 1)), "")
- If d.exists(temp) = True Then c.Resize(3, 1).Interior.ColorIndex = 38 Else c.Resize(3, 1).Interior.ColorIndex = 0
- Next
- r = r + 3
- Loop
- End With
- End Sub
½Æ»s¥N½X |
|