Thread: Range error
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
aimee209 aimee209 is offline
external usenet poster
 
Posts: 18
Default Range error

When I type in the code, I get an error when I try to define the range

Private Sub CommandButton2_Click()
Dim row As Integer
row = 4
Dim Range1 As Range

Range1=("D" & row:"G" & row) ' THIS LINE HAS THE ERROR MESSAGE

For Each a In Range1
If a.Value = "N/A" Then
a.Font.ColorIndex = 1
ElseIf a.Value = 0.945 Then
a.Font.ColorIndex = 10
ElseIf a.Value 0.895 Then
a.Font.ColorIndex = 44
ElseIf a.Value = 0 Then
a.Font.Color = vbRed
Else
a.Font.Color = vbBlack
End If
row.Value = row.Value + 4
Next
End Sub

Thanks!