+ Reply to Thread
Results 1 to 3 of 3

To DILIPandey about False Positive Results of a VBA Code.

  1. #1
    Registered User
    Join Date
    02-19-2013
    Location
    Houston, USA
    MS-Off Ver
    Excel 2010
    Posts
    21

    To DILIPandey about False Positive Results of a VBA Code.

    Hi DILIPandey,

    Sorry to bother again. The following is a code that you developed to help me replacing the repeated data with "same as above". Most of the time, it works very well. However, sometimes it creates "False Positive" results, replacing values that were not equal. Could you please help me explain why that happens. Thanks in advance.

    Best regards,

    Matt

    PHP Code: 
    Sub DILIPandey()
    'checking duplicates
    i = Range("l" & Rows.Count).End(xlUp).Row
    k = 0
    Range("l" & i, "P" & i).Select
    For n = 1 To i - 1
        For Each cell In Selection
            If cell = cell.Offset(-1, 0) Then
                k = k + 1
            End If
            If k = 5 Then
                Selection.Value = "same as above"
            k = 0
            End If
        Next
    Selection.Offset(-1, 0).Select
    Next
    End Sub 
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613

    Re: To DILIPandey about False Positive Results of a VBA Code.

    I rand the code on the sample data but I did not see any False matches. Can you indicate which rows were wrong (in the sample).
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    02-19-2013
    Location
    Houston, USA
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: To DILIPandey about False Positive Results of a VBA Code.

    Hi ProtonLeah,

    The code for the attached file works perfectly. I add the code to another Macro to get what I need to be done in a worksheet, and that's the time that false positive happened, replacing rows that not the same.

    If needed, I can post the code that I created and a file that has the problem. Thanks.

    Best regards,

    Matt

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VLookup that Results with False or Blank Results
    By mycon73 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-12-2013, 07:16 PM
  2. Replies: 14
    Last Post: 06-27-2012, 04:26 PM
  3. IF function returns false positive
    By AJMaine in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-07-2009, 03:09 PM
  4. [SOLVED] Positive Results
    By lmthomas in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  5. [SOLVED] Positive Results
    By [email protected] in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 06:05 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