LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
APPLY A CELL's FORMAT WITHOUT SELECTING Faraz A. Qureshi Excel Programming 3 December 22nd 09 08:54 PM
Apply format to row if yes response DebbieV Excel Discussion (Misc queries) 2 January 23rd 08 01:51 AM
Apply format with check box Luis A. Vázquez Excel Programming 1 October 16th 07 03:39 PM
How to apply an automatic format to a column? AussieBumBxl Excel Worksheet Functions 2 August 18th 07 03:23 PM
Extract a cells format and apply to a variable MikeR[_2_] Excel Programming 7 October 22nd 03 01:39 PM


All times are GMT +1. The time now is 08:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"