- ©«¤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# luke - Option Explicit
- Dim D As Object, DRng As Range
- Sub ¿z¿ï()
- ¸ê®Æ¿z¿ï
- With Sheet1.Range("L1")
- .CurrentRegion = ""
- If D.Count = 0 Then Exit Sub
- .Resize(D.Count, 3) = Application.Transpose(Application.Transpose(D.ITEMS))
- .CurrentRegion.Sort .Cells(1)
- End With
- End Sub
- Sub ´À¥N()
- Dim Rng As Range, R As Range, E As Range, C As Range
- ¸ê®Æ¿z¿ï
- Application.ScreenUpdating = False
- With Sheet1
- .Range("C:C").Value = .Range("C:C").Value '¥h°£"'"¦r¦ê'L1 ¦h¤@Ó
- Set Rng = .Range("L1").CurrentRegion
- For Each R In Rng.Columns(2).Cells 'MÄ檺Àx¦s®æ
- If DRng.Find(R.Offset(, 1), lookat:=xlWhole) Is Nothing And Application.CountIf(.[B:B], R.Offset(, 1)) > 0 Then
- 'NÄæ¸ê®Æ¤¤, ¦³»PBÄæ«D¶À©³Àx¦s®æªº¸ê®Æ¬Û¦P®É´N°±¤î°õ¦æVBA-> 'NÄ檺¦r¦ê¦b[¿z¿ï¸ê®ÆªºÀx¦s®æ]¤¤¤ñ¹ï¤£¨ì, ¥B[B:B]¤¤¦³¦¹¦r¦ê
- With .Range("B:B")
- .Replace R.Offset(, 1), "=XXX", xlWhole
- With .SpecialCells(xlCellTypeFormulas, xlErrors)
- .Value = R.Offset(, 1)
- .Select
- End With
- End With
- MsgBox R.Offset(, 1) & " ¦³«½ÆÈ."
- End
- End If
- With .Range("C:C")
- .Replace R.Value, "=XXX", xlWhole
- With .SpecialCells(xlCellTypeFormulas, xlErrors)
- .Value = R
- For Each E In .Areas
- For Each C In E.Cells
- If C.Offset(, -1) = R.Offset(, -1) Then C.Offset(, -1) = R.Offset(, 1)
- Next
- Next
- End With
- End With
- Next
- End With
- Application.ScreenUpdating = True
- End Sub
- Private Sub ¸ê®Æ¿z¿ï()
- Dim R As Range
- Set D = CreateObject("SCRIPTING.DICTIONARY")
- With Sheet1
- For Each R In .Range("B1", .Cells(.Rows.Count, "B").End(xlUp))
- If R <> "" And R.Cells(1, 2) <> "" Then
- D(R & R.Cells(1, 2)) = Array(R, R.Cells(1, 2), R) '¦s¤J¦r¨åª«¥ó: ¿z¿ïªº¸ê®Æ
- If DRng Is Nothing Then '¿z¿ï¸ê®ÆªºÀx¦s®æ
- Set DRng = R
- Else
- Set DRng = Union(R, DRng)
- End If
- End If
- Next
- End With
- End Sub
½Æ»s¥N½X |
|