- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 254
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-23
|
¦^´_ 12# owen9399 - Sub ¥þ³¡¤½¥qÁ`¦~³ø_«ö¶s1_Click()
- Dim Sh As Worksheet, A As Range, C As Range, Ay()
- For Each Sh In Sheets(Array("¤p«¬ªÑ", "¤j«¬ªÑ"))
- With Sh
- Set A = .[A:A].Find("¤½¥q§Ç¸¹", .[A65536], lookat:=xlWhole)
- Do Until Application.CountA(A.Offset(, 1).Resize(, 12)) = 0
- r = A.Row
- r1 = .Range("A:A").Find("¦Xp", A, lookat:=xlWhole).Row
- r2 = .Range("A:A").FindNext(.Cells(r1, 1)).Row
- For Each C In A.Offset(, 1).Resize(, 12).SpecialCells(xlCellTypeConstants)
- k = C.Column
- ReDim Preserve Ay(s)
- Ay(s) = Array(.Cells(r, k).Value, .Cells(r + 1, k).Value, .Cells(r1 + 1, k - 1).Value, .Cells(r1, k).Value, .Cells(r1 + 1, k + 1).Value, .Cells(r2, k).Value, "=rc6-rc5-rc10+rc11", "=if(rc5-rc6-rc10>0,0,rc6-rc5-rc10)", "=if(rc5-rc6-rc11<0,0,rc5-rc6-rc11)")
- s = s + 1
- Next
- Set A = .Range("A:A").Find("¤½¥q§Ç¸¹", .Cells(r2, 1), lookat:=xlWhole)
-
- Loop
- End With
- Next
- If s > 0 Then
- With Sheets("¥þ³¡¤½¥qÁ`¦~³ø")
- .UsedRange.Offset(1).Clear
- .[A2].Resize(s, 9) = Application.Transpose(Application.Transpose(Ay))
- .Range("A1").CurrentRegion.Sort key1:=.[A1], Header:=xlYes
- r = 42: k = 0
- Do Until .Cells(r, 1) = ""
- .Cells(r, 1).EntireRow.Insert
- .[A1:L1].Copy .Cells(r, 1)
- k = k + 1
- r = r + 40 + k
- Loop
- End With
- End If
- End Sub
½Æ»s¥N½X |
|