【问题标题】:vba colour of the cell单元格的vba颜色
【发布时间】:2019-05-17 17:03:15
【问题描述】:

我需要有关 vba 的帮助 如何将单元格(1,1)染成红色

【问题讨论】:

  • 向我们展示你迄今为止所做的尝试,这是一个程序员论坛

标签: excel vba


【解决方案1】:
 Cells(1,1).interior.colorindex = 3

【讨论】:

  • cells(1,1).interior.color=rgb(255,0,0)
  • 细胞(1,1).interior.color = vbRed
【解决方案2】:
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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-02-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-02
    • 1970-01-01
    • 2013-06-04
    • 2021-10-31
    相关资源
    最近更新 更多