Hi,

This loop is crashing my computer and i can't figure out why?

any suggestions? I think it only does the first 'i' loop i.e. i=1 and not getting to i=2

Private Sub Worksheet_Activate()
Dim r As Integer
Dim i As Integer
Dim c As String
Dim App(2) As String
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Dim Val1 As Double
Dim Val2 As Double
Set ws1 = Sheets("Breakdown Sheet")
Set ws2 = Sheets("App Summary")
c = "SWTPSCOMM"
App(1) = "App1"
App(2) = "App2"

ws2.Range("O7:O22").Value = ""

For i = 1 To 2
For r = 8 To 10

If ws1.Cells(r, "B").Value = App(i) Then
If ws1.Cells(r, "C").Value = c Then

Val1 = ws1.Cells(r, "G").Value

For x = 7 To 8
If ws2.Cells(x, "A").Value = App(i) Then Exit For
Next
r = x
Val2 = ws2.Cells(r, "O").Value + Val1
ws2.Cells(r, "O").Value = Val1

End If
End If
Next
Next
End Sub
Thanks