ExcelVBA@Workshop
HOME > Excel VBA サンプル集 > セルの背景色・文字色を設定する
セルの背景色・文字色を設定する

サンプルソース

' 背景色(青色)
Range("A1").Interior.ColorIndex = 5

' 文字色(白色)
Range("A1").Font.ColorIndex = 2

解説

Interior.ColorIndexで背景色を、Font.ColorIndexで文字色を設定します。



関連する内容



スポンサードリンク



Copyright (C) 2006-2008 ExcelVBA@Workshop All rights reserved.