- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 1# scjiao
¸Õ¸Õ¬Ý- Option Explicit
- Sub EX()
- Dim Rng(1 To 2) As Range, E As Range
- Dim AR(), i As Integer
- With Sheets("Sheet1")
- Set Rng(1) = .Range("A6", .Range("A" & .Rows.Count).End(xlUp)).SpecialCells(xlCellTypeConstants)
- 'Ū¨ú¾÷Á`ªº½d³ò¦³¤å¦rªºÀx¦s»Õ
- End With
- ReDim AR(0 To Rng(1).Areas.Count, 1 To 4)
- AR(0, 1) = "¾÷Á`"
- AR(0, 2) = "®Æ¸¹"
- AR(0, 3) = "´Áªì®w¦s"
- AR(0, 4) = "¹ê»Ú¶i®Æ"
- For i = 1 To Rng(1).Areas.Count
- AR(i, 1) = Rng(1).Areas(i).Cells(1)
- Set Rng(2) = Rng(1).Areas(i).Resize(, 2).Columns(2).SpecialCells(xlCellTypeConstants)
- '¾÷Á`ªº½d³ò [²Ä2Äæ] ¦³¤å¦rªºÀx¦s»Õ
- For Each E In Rng(2).Areas
- If E.Range("b1") + E.Range("E5") < AR(i, 3) + AR(i, 4) Then
- '"´Áªì®w¦s"+"¹ê»Ú¶i®Æ"
- AR(i, 2) = E.Cells(1)
- AR(i, 3) = E.Range("b1") '¥HE.Cells(1)
- AR(i, 4) = E.Range("E5")
- ElseIf AR(i, 2) = "" Then '®Æ¸¹: °}¦C¤¸¯À=""
- AR(i, 1) = Rng(1).Areas(i).Cells(1)
- AR(i, 2) = E.Cells(1)
- AR(i, 3) = E.Range("b1")
- AR(i, 4) = E.Range("E5")
- End If
- Next
- Next
- Sheets("Sheet2").[A1].Resize(UBound(AR), UBound(AR, 2)) = AR 'Åã¥Ü
- End Sub
½Æ»s¥N½X |
|