I wrote a vba code where if certain cells changes in value that excel will then run an existing macro. However, I keep getting an "Code execution has been interrupted" error almost 80% of the time that it runs. When I hit debug and press continue, everything works normally so I know there is nothing wrong with my code. Can someone please help me with this issue?
Below is my code:
Private Sub WeldCalc_Click()
Range("C428").Select
ActiveCell.FormulaR1C1 = "10"
Range("R502").GoalSeek Goal:=0, ChangingCell:=Range("C428")
ActiveWindow.ScrollRow = 1
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("C34") = "DWB" Then
If Target.Address = "$C$36" Or Target.Address = "$C$39" Or Target.Address = "$C$40" Or Target.Address = "$C$41" Or Target.Address = "$C$43" Or Target.Address = "$C$44" Then
WeldCalc_Click
End If
End If
End Sub
I even tried the phantom breakpoint method where you press ctrl pausebreak twice but it does not work.