Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Apply format to 0 cells
Hi All
I have a code below that formats cells - but it formats all cells in the row & I need it to only format cells 0 in the row. I tried a few things and got errors .... How do I incorporate the additional If Then Else into this code? Sub Decorate() Dim rngB As Range Dim rngTemp As Range Set rngB = Sheets("Sheet2").UsedRange.Columns("A:S") For R = 1 To rngB.Rows.Count If Sheets("Sheet2").Cells(R, 1).Value = Range("A3") Then Set rngTemp = Sheets("Sheet2").Cells(R, 1).Range("C1:S1") '''' If rngTemp.Value <1 Then (I tried adding this - but got a "type mismatch" error???) ''' Else rngTemp.Font.Bold = True With rngTemp.Interior ..ColorIndex = 41 ..Pattern = xlSolid ..PatternColorIndex = xlAutomatic End With '''' End If End If Next R End Sub -- Thank for your help BeSmart |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
APPLY A CELL's FORMAT WITHOUT SELECTING | Excel Programming | |||
Apply format to row if yes response | Excel Discussion (Misc queries) | |||
Apply format with check box | Excel Programming | |||
How to apply an automatic format to a column? | Excel Worksheet Functions | |||
Extract a cells format and apply to a variable | Excel Programming |