Consulting

Results 1 to 3 of 3

Thread: Conditional Format Macro help

  1. #1

    Question Conditional Format Macro help

    Hello! I was hoping for some help.

    I tried recording a macro for what I wanted but it didn't work out as needed. I am trying to compare two rows of data against one another. I have to annotate any changes I find within the two rows I am comparing. For example Row 1 vs Row 2. Row 3 vs 4 and so on.

    As of now, I am manually highlighting the two rows and running a conditional format of duplicate value so only those two rows are compared against one another. Generally, I have anywhere between 500 - 2000 rows within a worksheet which tends to get time consuming. My columns range from A - AR. Is there a macro out there to run a conditional format of duplicate values for every two rows within the worksheet? I am using Excel 2016 if that helps.

  2. #2
    Here is an example (row 92 vs 93. Row 94 vs 95 and so on).
    Capture.JPG

  3. #3
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,872
    I'm assuming you've got headers in row 1 of the sheet and you want tp start comparing thus: rows 2 & 3, rows 4 & 5 etc.
    Select the cells A2 to ARn where n is an odd number at the bottom of your range.
    Got to conditional formatting (remove anything already there) and use Use a formula to determine which cells to format and use the following formula:
    =IF(ISEVEN(ROW()),A2<>A3,A2<>A1)
    choose your highlight and OK.
    This will compare each cell in the selected area with the one above it or below it depending on whether it's on an odd or even numbered row and highlight if it's different.
    If this doesn't work as you want, attach a workbook.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Posting Permissions

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