Advertisement
MrMusAddict

Untitled

Aug 29th, 2016
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub math()
  2.  
  3. Dim rows As Long
  4.  
  5. rows = 0
  6.  
  7.  
  8. For i = 1 To 250 'i represents a
  9.  
  10.     Cells(2, 6).Value = i / 250 'tells me what % of the process we've completed
  11.    
  12.     For j = 1 To 250 'j represents b
  13.        For k = 1 To 250 'k represents c
  14.            
  15.             ''if the sqrt of a squared, b squared , and c squared is an integer
  16.            If Sqr(i ^ 2 + j ^ 2 + k ^ 2) / 1 = Sqr(i ^ 2 + j ^ 2 + k ^ 2) \ 1 Then
  17.                
  18.                 rows = rows + 1
  19.                
  20.                 ''tell me what that value is, as well as a, b, anc c
  21.                Cells(rows, 1).Value = Sqr(i ^ 2 + j ^ 2 + k ^ 2)
  22.                 Cells(rows, 2).Value = i
  23.                 Cells(rows, 3).Value = j
  24.                 Cells(rows, 4).Value = k
  25.            
  26.             End If
  27.            
  28.         Next k
  29.     Next j
  30. Next i
  31.  
  32.  
  33. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement