Sub Clearall()
Dim Ws As Worksheet
Set Ws = ThisWorkbook.Sheets("Sheet1")
Dim Clrallblue As Range
Set Clrallblue = Range("C14:I19")
For Each Cell In Clrallblue.Cells
With Cell
.ClearContents
.Borders.LineStyle = XlLineStyle.xlContinuous
.Interior.ColorIndex = RGB(153, 204, 255)
End With
Next Cell
End Sub
回答 2 件
ColorIndexはRGBを受け入れません。フルカラーインデックステーブルについては、こちらをご覧ください。 https://msdn.microsoft.com/en-us/vba/excel-vba/articles/colorindex-property
関連した質問
.ColorIndex
整数値が必要です。.Color
を使用する 代わりに、RGBを使用する場合。