ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ½Ð°Ý¬O§_¥i¥H¥ÎVBA ¦Û°ÊÀˬd­«½Æ¦WºÙ

¦^´_ 1# mark15jill
  1. Sub Ex()
  2.     Dim D As Object, R
  3.     Set D = CreateObject("Scripting.Dictionary")
  4.     For Each R In Range("A1").CurrentRegion.Columns(2).Cells
  5.         R.Interior.ColorIndex = xlNone
  6.         If Not D.EXISTS(R.Value) Then
  7.           Set D(R.Value) = R
  8.         Else
  9.           Set D(R.Value) = Union(D(R.Value), R)
  10.         End If
  11.     Next
  12.     For Each R In D.KEYS
  13.         If D(R).Cells.Count > 1 Then D(R).Interior.ColorIndex = 37
  14.     Next
  15. End Sub
½Æ»s¥N½X

TOP

¦^´_ 5# mark15jill
"¤j¤j ·Q½Ð°Ý¤@¤U ±z³o¨Çµ{¦¡¬O ¥H A1 §@¬°¨Ì¾Ú¥h·j¯Á¶Ü?"
Range("A1").CurrentRegion.Columns(2).Cells
¬O¥HA1©Ò©µ¦ùªº½d³òªº²Ä2ÄæColumns(2) ©m¦WÄæ§@¨Ì¾Ú
¥i­×§ï¬°Columns(?) Äæ§@¨Ì¾Ú
¥i¹î¬ÝCurrentRegionªº»¡©ú

TOP

        ÀR«ä¦Û¦b : ÁÀ¨¥¹³¤@¦·²±¶}ªºÂAªá¡A¥~ªí¬üÄR¡A¥Í©Rµu¼È¡C
ªð¦^¦Cªí ¤W¤@¥DÃD