I have written the below macro. The idea is to keep the macro running until the difference between 2 ranges (Dividend_payout and Dividend_payout_paste) become 0. The "dividend_payout_req_check" is the difference between the above 2 ranges. I have used this same type of macro before with and it seemed to work well. Currently the macro stops running and gives me a mismatch error no. 13.
if i ignore the error and keep activating the same macro, i eventually get the required result, but this requires several iterations and i keep getting the error even after the difference becomes "0". Any idea why this may be??
Thanks
Sub Dividend()
Do
Sheets("Funding").Select
Range("Dividend_payout").Select
Selection.Copy
Range("Dividend_payout_paste").Select
Selection.PasteSpecial Paste:=xlPasteValues
Application.CalculateFull
counter1 = Round(Range("Dividend_payout_req_check"), 4)
If counter1 = 0 Then
Exit Do
End If
Loop
End Sub
Bookmarks