+ Reply to Thread
Results 1 to 4 of 4

Camparing two Worksheets. Found code from forum but still need help.

  1. #1
    Registered User
    Join Date
    12-22-2014
    Location
    India
    MS-Off Ver
    2007
    Posts
    10

    Camparing two Worksheets. Found code from forum but still need help.

    Hi friend,
    I have a excel file which contains 2 sheets & needs to be compared & diference needs to be highlighted.

    I Have browsed the forum & found the foll. code but facing an issue. This code can compare & highlight the diference only if the data is small, say 1000 rows & columns till AZ. Bt I have a data of 6000 rows with columns names till GQ.

    Pls help

    Sub RunCompare()
    Call compareSheets("Before", "After")
    End Sub
    Sub compareSheets(shtBefore As String, shtAfter As String)
    Dim mycell As Range
    Dim mydiffs As Integer

    For Each mycell In ActiveWorkbook.Worksheets(shtAfter).UsedRange
    If Not mycell.Value = ActiveWorkbook.Worksheets(shtBefore).Cells(mycell.Row, mycell.Column).Value Then

    mycell.Interior.Color = vbYellow
    mydiffs = mydiffs + 1

    End If
    Next
    MsgBox mydiffs & " differences found", vbInformation
    ActiveWorkbook.Sheets(shtAfter).Select
    End Sub

  2. #2
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Camparing two Worksheets. Found code from forum but still need help.

    Maybe change this line

    Please Login or Register  to view this content.
    Happy with my advice? Click on the * reputation button below

  3. #3
    Registered User
    Join Date
    12-22-2014
    Location
    India
    MS-Off Ver
    2007
    Posts
    10

    Re: Camparing two Worksheets. Found code from forum but still need help.

    I'm glad that I found this forum.
    Thanks for your splendid & quick support.[SOLVED]

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Camparing two Worksheets. Found code from forum but still need help.

    Hi Nagato,

    Welcome to the forum.
    To mark your thread as Solved, please select Thread Tools (just above your first post) --> Mark thread as solved.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

+ 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. I'm so pleased that I found this forum...
    By aldica in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 12-12-2014, 06:21 PM
  2. CAMPARING 2 LISTS ( VLOOKUP OR any other function?)
    By ammy.rocks in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-23-2013, 11:02 AM
  3. Hi just found this forum
    By javanq in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 03-13-2013, 02:10 PM
  4. Replies: 1
    Last Post: 12-04-2012, 02:56 PM
  5. Just found the forum, looking for some help.
    By kgranger in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 07-22-2012, 08:18 PM

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