I'm new to VBA and was writing a simple code to take all numbers in column A and add 99 to those numbers in column B. However, as soon as it passes 1000, an overflow occurs. What can I do to cut off the while loop so it doesn't overflow the remaining columns with 99? Thanks!
Sub Button1_Click()
Dim n As Integer
n = 0
While Cells(1 + n, 1) <= 1000
If Cells(1 + n, 2) = 0 Then
Stop
End If
Cells(1 + n, 2).Value = Cells(1 + n, 1) + 99
n = n + 1
Wend
End Sub