Saladsamurai
08-26-2009, 11:32 AM
I know this isn't a 'degugging' forum, but does anyone see anything blatently obvious with this? When I click 'debug' I get the screenshot below the code.
Private Sub CommandButton1_Click()
Dim G, Y, R As Integer
Dim xgg, xgy, xgr, xyg, xyy, xyr, xrg, xry, xrr As Integer
xgg = 0
xgy = 0
xgr = 0
xyg = 0
xyy = 0
xyr = 0
xrg = 0
xry = 0
xrr = 0
G = 0
Y = 0
R = 0
For i = 1 To 25
For j = 1 To 32
If Worksheets(10).Cells(i, j) >= 0.9 Then
If Worksheets(9).Cells(i, j) >= 0.9 Then
xgg = xgg + 1
ElseIf Worksheets(9).Cells(i, j) < 0.9 And Worksheets(9).Cells(i, j) > 0.8 Then
xgy = xgy + 1
ElseIf Worksheets(9).Cells(i, j) <= 0.8 And Worksheets(9).Cells(i, j) <> "" Then
xgr = xgr + 1
G = G + 1
End If
ElseIf Worksheets(10).Cells(i, j) < 9 And Worksheets(10).Cells(i, j) > 0.8 Then
If Worksheets(9).Cells(i, j) >= 0.9 Then
xyg = xyg + 1
ElseIf Worksheets(9).Cells(i, j) < 0.9 And Worksheets(9).Cells(i, j) > 0.8 Then
xyy = xyy + 1
ElseIf Worksheets(9).Cells(i, j) <= 0.8 And Worksheets(9).Cells(i, j) <> "" Then
xyr = xyr + 1
Y = Y + 1
End If
ElseIf Worksheets(10).Cells <= 0.8 And Worksheets(10).Cells(i, j) <> "" Then
If Worksheets(9).Cells(i, j) >= 0.9 Then
xrg = xrg + 1
ElseIf Worksheets(9).Cells(i, j) < 0.9 And Worksheets(9).Cells(i, j) > 0.8 Then
xry = xry + 1
ElseIf Worksheets(9).Cells(i, j) <= 0.8 And Worksheets(9).Cells(i, j) <> "" Then
xrr = xrr + 1
End If
R = R + 1
End If
Next j
Next i
End Sub
debug:
http://i12.photobucket.com/albums/a220/saladsamurai/code.jpg
Private Sub CommandButton1_Click()
Dim G, Y, R As Integer
Dim xgg, xgy, xgr, xyg, xyy, xyr, xrg, xry, xrr As Integer
xgg = 0
xgy = 0
xgr = 0
xyg = 0
xyy = 0
xyr = 0
xrg = 0
xry = 0
xrr = 0
G = 0
Y = 0
R = 0
For i = 1 To 25
For j = 1 To 32
If Worksheets(10).Cells(i, j) >= 0.9 Then
If Worksheets(9).Cells(i, j) >= 0.9 Then
xgg = xgg + 1
ElseIf Worksheets(9).Cells(i, j) < 0.9 And Worksheets(9).Cells(i, j) > 0.8 Then
xgy = xgy + 1
ElseIf Worksheets(9).Cells(i, j) <= 0.8 And Worksheets(9).Cells(i, j) <> "" Then
xgr = xgr + 1
G = G + 1
End If
ElseIf Worksheets(10).Cells(i, j) < 9 And Worksheets(10).Cells(i, j) > 0.8 Then
If Worksheets(9).Cells(i, j) >= 0.9 Then
xyg = xyg + 1
ElseIf Worksheets(9).Cells(i, j) < 0.9 And Worksheets(9).Cells(i, j) > 0.8 Then
xyy = xyy + 1
ElseIf Worksheets(9).Cells(i, j) <= 0.8 And Worksheets(9).Cells(i, j) <> "" Then
xyr = xyr + 1
Y = Y + 1
End If
ElseIf Worksheets(10).Cells <= 0.8 And Worksheets(10).Cells(i, j) <> "" Then
If Worksheets(9).Cells(i, j) >= 0.9 Then
xrg = xrg + 1
ElseIf Worksheets(9).Cells(i, j) < 0.9 And Worksheets(9).Cells(i, j) > 0.8 Then
xry = xry + 1
ElseIf Worksheets(9).Cells(i, j) <= 0.8 And Worksheets(9).Cells(i, j) <> "" Then
xrr = xrr + 1
End If
R = R + 1
End If
Next j
Next i
End Sub
debug:
http://i12.photobucket.com/albums/a220/saladsamurai/code.jpg