【发布时间】:2019-05-17 17:03:15
【问题描述】:
我需要有关 vba 的帮助 如何将单元格(1,1)染成红色
【问题讨论】:
-
向我们展示你迄今为止所做的尝试,这是一个程序员论坛
我需要有关 vba 的帮助 如何将单元格(1,1)染成红色
【问题讨论】:
Cells(1,1).interior.colorindex = 3
【讨论】:
Option Explicit
Sub Test()
'In "with statement" we include the name of workbook & the name of worksheet we want to execute the code.
With ThisWorkbook.Worksheets("Sheet1")
'Using cell referencing
.Cells(1, 1).Interior.Color = vbRed
'Using range referencing
.Range("A1").Interior.Color = vbRed
End With
End Sub
【讨论】: