Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Note: This assumes you have contiguous data in column "A." You can
modify as necessary. Sub fillBasedOnValue() Dim myCell As Variant Set myCell = Range("A2") Do While Not IsEmpty(myCell) Set nextcell = myCell.Offset(1, 0) Select Case myCell Case 51 To 69 myCell.Interior.Color = vbYellow Case 70 To 90 myCell.Interior.Color = vbGreen Case Is 90 myCell.Interior.Color = vbRed End Select Set myCell = nextcell Loop MsgBox "File Done" End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Thanks for the solution, the macro which u had given to me is working very fine. But i want that the macro should run autometically, I mean to say that i dont want to press the shortcut key every time to run the macro. i want the product of A & B in Column C Now i want that if the product of coulmn C is between 51 To 69 then it should be yellow in color and if the product is beween 70 To 90 it should be autometically green color and if greater than 90 then it should be Red Color. I dont want to run the macro everytime. By you solution i have to run it evertime after i calculate the value. Its not comming autometically. Pls do help me by giving proper solution. Regards Akash On Jan 3, 11:23 am, "MrScience" wrote: Note: This assumes you have contiguous data in column "A." You can modify as necessary. Sub fillBasedOnValue() Dim myCell As Variant Set myCell = Range("A2") Do While Not IsEmpty(myCell) Set nextcell = myCell.Offset(1, 0) Select Case myCell Case 51 To 69 myCell.Interior.Color = vbYellow Case 70 To 90 myCell.Interior.Color = vbGreen Case Is 90 myCell.Interior.Color = vbRed End Select Set myCell = nextcell Loop MsgBox "File Done" End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Auto Fill Color Cell | Excel Worksheet Functions | |||
How I auto fill a cell patern or color based on a pick list? | Excel Discussion (Misc queries) | |||
auto fill color of row | Excel Worksheet Functions | |||
auto fill color of row | Excel Worksheet Functions | |||
auto color fill cells | New Users to Excel |