Results 1 to 1 of 1

compare code in two sheets

Threaded View

  1. #1
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    compare code in two sheets

    Private Sub CommandButton1_Click()
    Dim i As Long
    
    i = Range("D" & Rows.Count).End(xlUp).Row
        For Each rngCell In Range("D2:D" & i)
    
    If Range("D2:D").value = "" Then
    Else
    	
    If Range (“D2:D”) “Template” = Range(“D2:D”) “Source” Then
    (“A2:A”),(“B2:B”),(“C2:C”),(“D2:D”),(“E2:E”),(“F2:F”),(“G2:G”),(“H2:H”),(“I2:I”), “Low Coverage”
    
    
    If Range (“D2:D”) “Template” = Range(“D2:D”) “” AND(“J2:J”) = “Y”  in “Source” Then
    Range (“J2:J”) in “Low Coverage”
                  .Interior.Color = RGB(255, 0, 255) 'Pink
    Else
    
    If Range (“D2:D”) “Template” = Range(“D2:D”) “Source “ AND(“J2:J”) = “N” in “Source” Then
    Range (“J2:J”) in Low Coverage
                  .Interior.Color = RGB(53, 153, 102) 'Green
    Else
    
    If Range (“D2:D”) “Template” = Range(“D2:D”) “Source “ AND(“J2:J”) = “” in “Source” Then
    Range (“J2:J”) in Low Coverage
                  .Interior.Color = RGB(255,255, 0) 'Yellow
                  .Value = “?”
    
    Next rngCell
    
    End Sub
    Above is my attempt to accomplish this when the user clicks compare amplicons:

    STEP 1: Match column D in Template with column D in Source if it is highlighted Red.
    STEP 2: If there is a match then to the Low Coverage worksheet all the information in columns A,B,C,D,E,F,G,H,I,J
    STEP 3: Match column D in Template with column D in Source AND If in Column J there is a Y then column J in Low Coverage is Pink, if in Column J there is a N then column J in Low Coverage is Y Green, if in Column J is “” then column J in Low Coverage is Yellow with a ? in it

    I'm sure it is not right, any assistance would be appreciated. I attached the spreadsheet as well. Thank you.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Code to compare data in 2 sheets and delete duplicates
    By amar05 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-13-2013, 03:24 PM
  2. [SOLVED] Need micro compare code in sheet2 and sheet3 with code in sheet1
    By jamalmail in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-21-2013, 05:15 PM
  3. [SOLVED] Compare Two Value in Different Sheets
    By gingank in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 07-21-2012, 11:01 PM
  4. Compare sheets
    By alogoc in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-17-2009, 10:53 AM
  5. Compare two sheets
    By Dhruva101 in forum Excel General
    Replies: 0
    Last Post: 06-04-2007, 04:06 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