Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8223673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:47:26+00:00 2026-06-07T14:47:26+00:00

I have 4 columns, A through D. I need to find rows where column

  • 0

I have 4 columns, A through D. I need to find rows where column C is the same in each row, and column D is the same in each row. It would be best to have a True or False value placed in column E. VBA or a formula works, although I’d think something like this is do-able with a formula.

For example, I have the following:

Row 1 XX 123 XYZ
Row 2 XX 234 XYZ
Row 3 XX 234 YZX
Row 4 XX 234 YZX

In this example, Column E would be False for Rows 1 and 2 and True for Rows 3 and 4.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T14:47:30+00:00Added an answer on June 7, 2026 at 2:47 pm

    Is this what you are trying?

    Sub Sample()
        Dim ws As Worksheet
        Dim lRow As Long, i As Long
    
        Set ws = Sheets("Sheet1")
    
        With ws
            lRow = .Range("C" & .Rows.Count).End(xlUp).Row
    
            For i = 1 To lRow
                If i = 1 Then
                    If .Range("C" & i).Value = .Range("C" & i + 1).Value And _
                    .Range("D" & i).Value = .Range("D" & i + 1).Value Then _
                    .Range("E" & i).Value = "True" Else .Range("E" & i).Value = "False"
                Else
                    If (.Range("C" & i).Value = .Range("C" & i + 1).Value And _
                    .Range("D" & i).Value = .Range("D" & i + 1).Value) Or _
                    (.Range("C" & i).Value = .Range("C" & i - 1).Value And _
                    .Range("D" & i).Value = .Range("D" & i - 1).Value) Then _
                    .Range("E" & i).Value = "True" Else .Range("E" & i).Value = "False"
                End If
            Next i
        End With
    End Sub
    

    SNAPSHOT

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to find rows in resultsets that have every column without null. These
I have two columns, each with many rows/divs. I'm trying to get jQuery UI
I have a Datatable with Id(guid) and Name(string) columns. I traverse through the data
I have two columns say Main and Sub . (they can be of same
I have two columns. Column E extends up to 99504 (values) and column I
I have two columns A and B, and would like to get a list
I need to find records in a dataset that have certain values from more
Within my Windows.Resources I have the following column defined: <DataGridTextColumn x:Key=CustomColumn x:Shared=False> <DataGridTextColumn.Header> <StackPanel>
I need to have multiple lines in a cell, so I use DataGridViewTextBoxColumn.DefaultCellStyle.WrapMode =DataGridViewTriState.True.
I have a table called specs . I need to edit multiple rows from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.