excelVBA设置单元格颜色

2025-04-11 00:05:08
推荐回答(1个)
回答1:

Cells(1, 1).Font.ColorIndex = 3 '字的颜色号为3 红色
Cells(1, 1).Interior.ColorIndex = 3 ' 背景的颜色为3 红色
Cells(2, 1).Font.Color = RGB(0, 255, 0) '字的颜色绿色
Cells(2, 1).Interior.Color = RGB(0, 0, 255) '背景的颜色蓝色