View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default conditional format column

Based on your new information, this should do it:Sub Macro1()
n = Cells(Rows.Count, "E").End(xlUp).Row
Range("D1:D" & n).Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreater, _
Formula1:="=$B$3"

Selection.FormatConditions(Selection.FormatConditi ons.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16383844
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13551615
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
End Sub

NOTICE: This is for Excel 2007. Not sure what version you use. I'm at
school now; all we have here is 2007. I can test on 2003 when I get home
tonight, won't be until after 11 though.

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Peruanos72" wrote:

That's good info but what i'm looking for is code that will create a
conditional
format for each cell in column D where for each individual cell minus(-)
cell B3 30
the cell is formated. What I'm having trouble with is writing the code to
apply the format to each individual cell. Cell B3 remains constant but the
references for the other cells will change.

Ex: D3-B330; D4-B330;D5-B330

"ryguy7272" wrote:

Take a look at this:
http://www.datapigtechnologies.com/f...rmatexcel.html

This is good too:
http://www.datapigtechnologies.com/f...tlformats.html

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Peruanos72" wrote:

Hello,

In column "D" I have a date in each cell and I want to add a conditional
format
for each cell where if that cell - B3 30 the cell bolds and the font turns
red.
Cell B3 is a date as well. I'm using the last cell in column "E" to find the
range.

Thanks!!