Consulting

Results 1 to 4 of 4

Thread: Solved: Checklist compare

  1. #1

    Solved: Checklist compare

    Morning Everyone

    I require some assistance with comparing columns and creating a checklist to confirm.

    I want to have Column A as a check list to mark off all the compared columns to confirm it's good, so X for compare is correct.

    For clarification i want compare column B and C, D and E, F and G, and so on. I may need more columns to compare also, but i can reuse the prior the code above

    But when they do the compare for each two comparison, B and C vs D and E - if both are correct i need column A to have an X to show all the compares are matching. I've attached an excel document of the desired output.

    If possible I need a macro to do this.

    Your help is really appricated and thank you for your assistance on this matter. Vbaexpress forum is probably the best place to learn new stuff.
    Attached Files Attached Files

  2. #2
    I have the following code here that works for one cell, but not so sure how to do for a range of cells..:S..it's a start?

    [VBA]
    Sub Test()
    wsName = "Sheet1"
    Worksheets("Sheet1").Activate
    Dim FirstMatch As Boolean
    Dim SecondMatch As Boolean
    intColNum = 1

    'For intRowCount = 1 To Sheets(wsName).Range("E").CurrentRegion.Rows.Count
    If Range("B2").Value = Range("C2").Value Then
    FirstMatch = True
    Else
    FirstMatch = False
    End If
    If Range("D2").Value = Range("E2").Value Then
    SecondMatch = True
    Else
    SecondMatch = False
    End If

    If FirstMatch = True And SecondMatch = True Then
    Range("A2").Value = "x"
    ElseIf FirstMatch = False And SecondMatch = True Then
    Range("A2").Value = "False"
    ElseIf FirstMatch = False And SecondMatch = False Then
    Range("A2").Value = "False"
    ElseIf FirstMatch = True And SecondMatch = False Then
    Range("A2").Value = "False"

    End If
    'Next intRowCount
    End Sub
    [/VBA]

  3. #3
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    I was going to suggest a formula like
    =IF(AND(B1=C1,D1=E1,F1=G1),"x","")

    But then I noticed that the file considers "String 2" and "String2" as the same. (Cells D2 and E2)
    Is that correct or an error in the example?

  4. #4
    it is error. my apologies.

Posting Permissions

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