スコア
23
Advertisement
以下のスクリーンショットはExcel 2010のものですが、2007のものと同じです。
セルを選択して、Conditional Formatting | Highlight Cells Rules | Text that Contains
UPDATE:ワークシート全体に条件付き書式設定を適用するには、すべてのセルを選択してから条件付き書式設定を適用してください。
解決策が見つかりました
より。http://www.mrexcel.com/forum/excel-questions/861678-highlighting-rows-random-colors-if-there-duplicates-one-column.html#post4185738 ] (http://www.mrexcel.com/forum/excel-questions/861678-highlighting-rows-random-colors-if-there-duplicates-one-column.html#post4185738)
Sub ColourDuplicates()
Dim Rng As Range
Dim Cel As Range
Dim Cel2 As Range
Dim Colour As Long
Set Rng = Worksheets("Sheet1").Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row)
Rng.Interior.ColorIndex = xlNone
Colour = 6
For Each Cel In Rng
If WorksheetFunction.CountIf(Rng, Cel) > 1 And Cel.Interior.ColorIndex = xlNone Then
Set Cel2 = Rng.Find(Cel.Value, LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=False, SearchDirection:=xlNext)
If Not Cel2 Is Nothing Then
Firstaddress = Cel2.Address
Do
Cel.Interior.ColorIndex = Colour
Cel2.Interior.ColorIndex = Colour
Set Cel2 = Rng.FindNext(Cel2)
Loop While Firstaddress <> Cel2.Address
End If
Colour = Colour + 1
End If
Next
End Sub