View Single Post
  #19   Report Post  
Posted to microsoft.public.excel.programming
ytayta555 ytayta555 is offline
external usenet poster
 
Posts: 247
Default Totally stuck trying to format,loop etc...please help a novice

For your Step 2 , as I see , ker_01 brought the solution ,
the second very clever formula , =IF(B2*C10,B2+C1,B2) , :
http://groups.google.ro/group/micros...b0c6bddb4c1d8#


and , next code , maybe cover really all your needs :

Sub GIVEATRYFORSTEPTWO()

Dim FromWbook As Worksheet
Dim myCell As Range
Dim myRng1 As Range

Set FromWbook = Workbooks("YYYYY.xls").Worksheets("YYYYY")

With FromWbook
Set myRng1 = .Range("G11:G71")
End With

For Each myCell In myRng1.Cells
If myCell.Value < 0 Then
myCell.Font.ColorIndex = 4
ElseIf myCell.Value 0 Then
myCell.Font.ColorIndex = 3
Else
End If
If myCell.Value = 9 Then
myCell.Select
Selection.Font.Bold = True
Selection.Font.ColorIndex = 1
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
ElseIf myCell.Value = -9 Then
myCell.Select
Selection.Font.Bold = True
Selection.Font.ColorIndex = 1
With Selection.Interior
.ColorIndex = 4
.Pattern = xlSolid
End With
Else
End If
Next myCell

End Sub