Comparing Excel Sheets
Power Query Course in Spanish
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Comparing Excel Sheets

  1. #1
    New Member
    Join Date
    Jan 2002
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Is there any way of comparing Excel sheets? I want to compare similar sheets prepared on two computers and have any differences highlighted in some way. I know this can be done in text files, but I can't see how it is done in Excel.

    Regards
    Bigchips

  2. #2
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Try the following:

    Sub CheckWS()
    Dim Sheet1rng, Sheet2rng As Range
    Set Sheet1rng = Worksheets("Sheet1").UsedRange
    Set Sheet2rng = Worksheets("Sheet2").UsedRange
    For cell = 1 To Sheet1rng.Cells.Count
    If Sheet1rng(cell) <> Worksheets("Sheet2").Range(Sheet1rng(cell).Address) Then Sheet1rng(cell).Interior.ColorIndex = 3
    Next cell
    For cell = 1 To Sheet2rng.Cells.Count
    If Sheet2rng(cell) <> Worksheets("Sheet1").Range(Sheet2rng(cell).Address) Then Worksheets("Sheet1").Range(Sheet2rng(cell).Address).Interior.ColorIndex = 3
    Next cell
    End Sub

    It will highlight in red all the cells on Sheet1 that are not equal to cells on Sheet2.
    Best regards,
    Allan Chara
    http://www.mrspreadsheets.com

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com