View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default sort for variables

Another possible error would be using code to do this when you could use the
builtin Conditional Formatting feature under the Format menu.

Regards,
Tom Ogilvy

"Bob" wrote in message
...

Having trouble coding a procedure to look at two values in each row of a
set of data, coloumns (J) and (K). Based on these values I want to
colour the row one colour if the values are both below zero and another
if they are not. Can anyone explain where I'm going wrong? Below is
what i've been trying.

Thanks, Bob




Private Sub CommandButton3_Click()
For i = 1 To 30
If Range("Ji") < 0 And ("Ki") < 0 Then
Range("Ji:Ii").Select
Selection.Font.ColorIndex = 3
Else
Range("Ji:Ii").Select
Selection.Font.ColourIndex = 4
End If
Next i
End Sub

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!