You have two For... statements, but only one Next statement. You need a Next for each For.
Also, your Next statement is within an If...Then block that's within one of the For... loops, which won't work. Your code should look like this:
Code:
For MAX = 1 To 200
For MIN = 1 To 200
If cmdRandom.CausesValidation Then
' Do something
End If
Next MIN
Next MAX
Finally, the code in the inner loop will execute 40,000 times (200 * 200). It's unlikely that cmdRandom's CausesValidation property will change inside the loop, so you should probably test it once before entering the loops, rather than testing it 40,000 times. ;)
Code:
If cmdRandom.CausesValidation Then
For MAX = 1 To 200
For MIN = 1 To 200
' Do something
Next MIN
Next MAX
End If