美文网首页VBA研究
对指定单元格涂色

对指定单元格涂色

作者: mew_c360 | 来源:发表于2019-08-22 11:01 被阅读0次

Dim rng_usedRange As Range

    Set rng_usedRange = Worksheets(fName).UsedRange

    For Each rng_color In rng_usedRange

        If rng_color.Value = "OUTPUT" Then

            colCnt = Cells(rng_color.Row, Columns.Count).End(xlToLeft).Column

            For c = rng_color.Column To colCnt

                If Worksheets(fName).Cells(rng_color.Row, c).Value <> "" Then

                    Worksheets(fName).Cells(rng_color.Row, c + 1).Interior.Color = RGB(205, 197, 191)

                End If

            Next

        End If

    Next

相关文章

网友评论

    本文标题:对指定单元格涂色

    本文链接:https://www.haomeiwen.com/subject/zoagsctx.html