设置excel表格中单元格中的背景颜色

来源:互联网 发布:金和软件 福州 编辑:程序博客网 时间:2024/05/16 07:21

Sheet1.Cells(1,1)Interior.ColorIndex = 1 ‘设置Sheet1表中的第一行第一列的单元格背景颜色为黑色

Sheet1.Rows(3).Interior.ColorIndex=2 '设置Sheet1表中的第三行背景颜色为白色

标题: EXCEL开发—Interior.ColorIndex 色彩列表收藏

无色0 19 38 1 20 39白色2 21 40 3 22 41 4 23 42 5 24 43 6 25 44 7 26 45 8 27 46 9 28 47 10 29 48 11 30 49 12 31 50 13 32 51 14 33 52 15 34 53 16 35 54 17 36 55 18 37 56

 

 

如何取 cell Interior.ColorIndex 值:

Dim A As Integer
A = ActiveCell.Interior.ColorIndex
MsgBox A