PASTEKAN KODE BERIKUT PADA SEBUAH MODUL
Sub Duplicate_1Creteria()
Dim myRange, myRange1
As Range
Dim i As Integer
Dim j As Integer
Dim myCell As Range
Set myRange =
Range("b3:B24")
For Each myCell In
myRange
If
WorksheetFunction.CountIf(myRange, myCell.Value) = 2 Then
myCell.Interior.ColorIndex
= 6
ElseIf
WorksheetFunction.CountIf(myRange, myCell.Value) = 3 Then
myCell.Interior.ColorIndex
= 7
ElseIf
WorksheetFunction.CountIf(myRange, myCell.Value) = 4 Then
myCell.Interior.ColorIndex
= 8
ElseIf
WorksheetFunction.CountIf(myRange, myCell.Value) = 5 Then
myCell.Interior.ColorIndex
= 12
End If
Next
[C3:C24].Formula =
"=COUNTIF($B$3:B24,B3)"
End Sub
SELAMAT MENCOBA
No comments:
Post a Comment