+ Reply to Thread
Results 1 to 6 of 6

Error 92: For loop not initialized...how to fix?

  1. #1
    Registered User
    Join Date
    10-26-2011
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Error 92: For loop not initialized...how to fix?

    Code:

    Please Login or Register  to view this content.
    Hi, I'm new to VBA and am having trouble running this macro. For some reason, whenever i try to run it i get:
    error 92: "For loop not intialized", at the point where i put the coding in for the Account Errors msg box. Any idea how to fix this error? It seems to work on other worksheets, just not my particular one.

    Thanks

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Error 92: For loop not initialized...how to fix?

    Hi

    It is being caused when there are no errors to action. Try something like

    Please Login or Register  to view this content.
    HTH

    rylo

  3. #3
    Registered User
    Join Date
    10-26-2011
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Error 92: For loop not initialized...how to fix?

    Appreciate that. It started working to an extent. However it now only list the differences on the Expenses worksheet, not both the worksheets. Another issue is that it lists all data missing to the right of one point, even if the data is there. Ie. if i clear one cell and then run the macro, it says that all the information to the right of that cleared cell is missing, even though it isnt.

    I have uploaded my .xlsm file for a better understanding. I dont really know where to go from here. Thanks
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Error 92: For loop not initialized...how to fix?

    Hi

    All the expenses from both sheets seem to be in the comparison area.

    Can you set up something that has deliberate errors, and give the expected output you want to receive.

    rylo

  5. #5
    Registered User
    Join Date
    10-26-2011
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Error 92: For loop not initialized...how to fix?

    I have removed "5061" Taxes account number (celll O4) from the Expenses! Worksheet.

    If you now run the macro, it comes up saying that all account numbers to the right of O4 (ie. O4:X4) are missing in expenses, whereas they are in fact still there.

    I need the macro to be able to recognize differences in both worksheets. I have added another account number "5202" in Expenses! Worksheet in Y4 as a test. When I run the macro, i need it to come up and display the differences in both worksheets. That is, if there is an account number in Expenses! and not in ExpenseList! it needs to appear and vice versa. I need both.

    Also I tried putting in deliberate errors under my first coding situation with the error and still had the same error come up?

    I have attached both an updated excel file and also an example image of what I need my output to look like, with random example account numbers

    thanks
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by excelspud; 11-01-2011 at 07:27 PM.

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Error 92: For loop not initialized...how to fix?

    Hi

    Try this. It does away with the conversion of the ranges to arrays, and works with the ranges directly.

    Please Login or Register  to view this content.
    rylo

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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