Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Subscript out of range error - save copy error | Excel Programming | |||
Range.Select error and screen maximizing error in Workbook_Open() | Excel Programming | |||
Range.Select error and screen maximizing error in Workbook_Open() | Excel Programming | |||
Help with this error Unknown reason for error with Range().Select | Excel Programming | |||
Type Mismatch error & subscript out of range error | Excel Programming |