+ Reply to Thread
Results 1 to 15 of 15

comparison macro

Hybrid View

  1. #1
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    848
    Please wrap the code in your last two posts.

    You can shorten the column deletion code. There is no need to select the columns. Here is a quick example to delete colUmns A, B, F, G, H, P, and q:
    Range("A:C, F:H,P:Q").Delete
    You should be able to paste my macro to the end of the one you posted. and have it run that way. Remove the End Sub at the end of your macro and the Sub Name() from the beginning of mine.

  2. #2
    Registered User
    Join Date
    05-16-2006
    Posts
    93

    work well thanks

    It's only when one runs one's macro does one see the flaws in it. I found that In need to not only highlight if the values are different between sheet 1 and sheet 2 but also if the interior color is different.
    I tried adding the line
    If Worksheets("max").Cells(i, j).Interior.Color <> Worksheets("mine").Cells(i, j) Then
                If Worksheets("max").Cells(i, j).Value <> Worksheets("mine").Cells(i, j) Then
    and added an additional end if, the macro still runs, takes longer to run but doesn't actually highlight a cell where the value on (e.g.) sheet1 cell a1 = the value of sheet2 cell a1 but where the fill color of the cell differs. I would have thought my addition would have done it ...but it doesn't seem to!

+ 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