- ©«¤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# eric093
¸Õ¸Õ¬Ý- Option Explicit
- Sub aa()
- Dim Rng(1 To 4), E As Range
- Set Rng(1) = Sheets(1).Range("A2")
- 'Set Rng(2) = Sheets(1).Range("G:G") '½d³ò¤j(¾ãÄæ)¬Û¹ï¶]°j°é®É¶¡ªø
- Set Rng(2) = Sheets(1).Range("G2", Sheets(1).Range("G2").End(xlDown)) '½d³ò¤p(¦³¸ê®Æªº¾ãÄæ)
- Do While Rng(1) <> ""
- Set Rng(3) = Rng(2).Find(Rng(1), lookat:=xlWhole)
- If Not Rng(3) Is Nothing Then
- For Each E In Rng(2) '©Ò¦³«È¤á½s¸¹¤¤¶]°j°é
- If Rng(1) = E And Rng(1).Offset(, 3) = E.Offset(, 1) Then '¤U³æªÌ¬Û¦P
- Rng(1).Offset(, 4).Value = E.Offset(, 2)
- End If
- Next
- End If
- Set Rng(1) = Rng(1).Offset(1)
- Loop
- End Sub
- Sub Ex()
- Dim Rng(1 To 3) As Range, E As Range
- Set Rng(1) = Sheets(1).Range("A2")
- Set Rng(2) = Sheets(1).Range("G:G")
- Do While Rng(1) <> ""
- Set Rng(3) = Rng(2).Find(Rng(1), lookat:=xlWhole)
- If Not Rng(3) Is Nothing Then
- With Rng(2)
- .Replace Rng(1), "=5/0" '¬Û¦P«È¤á½s¸¹§ó´«¬°¿ù»~È
- With .SpecialCells(xlCellTypeFormulas, xlErrors) '¿ù»~Ȫº½d³ò
- For Each E In .Cells '¶È¬Û¦P«È¤á½s¸¹¤¤¶]°j°é
- If E.Offset(, 1) = Rng(1).Offset(, 3) Then Rng(1).Offset(, 4) = E.Offset(, 2)
- '¤U³æªÌ¬Û¦P
- Next
- .Value = Rng(1) '¿ù»~ȧï¦^¬°«È¤á½s¸¹
- End With
- End With
- End If
- Set Rng(1) = Rng(1).Offset(1)
- Loop
- End Sub
½Æ»s¥N½X |
|