+ Reply to Thread
Results 1 to 3 of 3

Macros not accurate???

  1. #1
    Registered User
    Join Date
    05-25-2010
    Location
    V
    MS-Off Ver
    Excel 2003
    Posts
    18

    Question Macros not accurate???

    Hello All,

    I have made a macro which is designed to compare cells, under certain conditions. The table that i want to analyze eventually has 17500 rows. For this reason the macro has a variant in order to make a loop and test if the conditions are met for every row. I have tasted the macro many times and for different numbers, for example:

    For i= 3 to 50 or
    For i= 100 to 200

    And everything worked perfectly.

    The problem is that when i run it for all the rows or even for big number of rows( over 100-150) it seems in the results that it starts jumping rows.i can see that it does that because the outcome of the macro is to change the color of the cells according to the conditions. But when i go to the area of the problem and i run the macro again just for this part, for example:

    For i=159 to 200

    everything once again works excellent!

    What do you think it could be the problem? is there a matter of accuracy in the macros?? if yes how can i fix it???


    Thank you in advance

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Macros not accurate???

    Hi,

    Seeing the rest of your code would help and even more a sample workbook demonstrating the problem.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Macros not accurate???

    There's nothing wrong with the code you've posted, if there is a problem it's going to be the code within the loops.

    Getting incorrect results can happen for a number of reasons - if you are comparing values then accuracy/rounding might be a cause.

    A major reason for things eg ranges, columns etc being skipped is because they are being deleted at some point.

    That can sort of throw the looping off a bit.

+ 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