
セルの背景色を設定するには、FontオブジェクトのColorプロパティを使います。
例

たとえば、セルB2のフォントの色を赤にするには次のように記述します。
Sub SetFontColor() Range("B2").Font.Color = RGB(255, 0, 0) End Sub
実行結果

comments powered by Disqus
スポンサーリンク
2017年6月25日 (日) 20:54 in Excel , VBA
Sub SetFontColor() Range("B2").Font.Color = RGB(255, 0, 0) End Sub
スポンサーリンク