Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
color formatting from vbe
hi all.. i need to make the macro to format all the cells of my workbook like
this... if cell is equal to 2 then paint it red end if if cell is equal to 1 then paint it blue end if help me !! byyy |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
color formatting from vbe
You could use Conditional Formatting, but with VBA:
Sub color_them() For Each r In ActiveSheet.UsedRange v = r.Value If v = 1 Then r.Interior.ColorIndex = 3 Else If v = 2 Then r.Interior.ColorIndex = 5 End If End If Next End Sub -- Gary''s Student - gsnu200788 "N+" wrote: hi all.. i need to make the macro to format all the cells of my workbook like this... if cell is equal to 2 then paint it red end if if cell is equal to 1 then paint it blue end if help me !! byyy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Color formatting | Excel Worksheet Functions | |||
Color formatting with VBA | Excel Programming | |||
Color Formatting | Excel Discussion (Misc queries) | |||
Conditional color formatting entries have wild color. | Excel Discussion (Misc queries) | |||
Color Formatting | Excel Programming |