Results 1 to 5 of 5

My loop macro is not working, returning a mismatch error??

Threaded View

  1. #1
    Registered User
    Join Date
    02-10-2014
    Location
    Jeddah, Saudi Arabia
    MS-Off Ver
    Excel 2010
    Posts
    2

    My loop macro is not working, returning a mismatch error??

    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
    Last edited by arlu1201; 02-10-2014 at 05:44 AM. Reason: Use code tags in future.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] For Next Loop in column - type mismatch error
    By TC1980 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-03-2013, 09:14 AM
  2. Mismatch error from nested Do While loop?
    By scope951 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-26-2010, 01:01 PM
  3. Type MisMatch error (13) with if statement using loop
    By mdnghtsnpr in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-26-2010, 10:37 AM
  4. Error 13 Type Mismatch in For Next Loop
    By VBAxellence in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-30-2009, 12:47 PM
  5. DoWhile Loop & Type mismatch error
    By oakman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-27-2006, 06:28 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1