I have written the code below. It runs fine until j = 485000 , then I get run-time error overflow. What Am I doing wrong?
Thanks for your help!
Code:
Sub Breakeven()
Dim i As Integer, j As Long, k As Byte, l As Long
With ThisWorkbook
For i = 0 To 9
j = 445000 + 10000 * i
Range("c2") = j
For k = 0 To 9
l = 2300 + 500 * k
Range("c3") = l
Calculate
Range("c5").GoalSeek Goal:=0, ChangingCell:=Range("c4")
Range("c4").Select
Selection.Copy
Sheets("Sens").Cells(9 + i, 3 + k).Select
Selection.PasteSpecial Paste:=xlPasteValues
Next k
Next i
End With
End Sub
Thanks for your help!