简体   繁体   English

excel 2003 vba 宏

[英]excel 2003 vba macros

I am trying to write a macro in excel 2003 which does the following: From multiple cells in a given range (ex a11:z20), highlight the cells based on its changing cell value (ex 60 to 100), 9-10 different condition.我正在尝试在 excel 2003 中编写一个宏,它执行以下操作:从给定范围内的多个单元格(例如 a11:z20),根据其不断变化的单元格值(例如 60 到 100)突出显示单元格,9-10 个不同的条件. values that are false are not highlighted.错误的值不会突出显示。

Do you mean some functions like this one?你的意思是一些像这样的功能吗?

Sub FillCells()
Dim myCells As Range
For Each myCells In Range("A11:Z20").Cells
    If myCells.Value >= 60 And myCells.Value <= 100 Then
        myCells.Interior.Color = vbYellow
    End If
Next myCells
End Sub

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM