简体   繁体   中英

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. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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