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 6727785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:05:26+00:00 2026-05-26T10:05:26+00:00

What is an efficient way to find values in a range, eg Range(A1:A2), that

  • 0

What is an efficient way to find values in a range, eg Range(“A1:A2”), that exist in the same order within a second range, eg Range(“B:B”).

My seach has only come up with two possibilities so far:
1) Using a loop to iterate through the second range.
2) Using Range(“B:B”).Find to search for the value in “A1” and then testing for the value of A2 in the consecutive cell. Values in Range(“B:B”) is not unique so need to to keep finding until nothing found.

Is there another option I haven’t considered?

  • 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-05-26T10:05:26+00:00Added an answer on May 26, 2026 at 10:05 am

    While (2) sounds sensible, another quick way would be to concatenate B1 and B2 into a single cell in a working column ( manually or with VBA), repeating for B2 & B3 Etc, and then match the combined string in a single lookup

    [Update]

    You could use a working column like so. The || concatenator is used to avoid false matches, an error check handles the no match situation

    Sub ConCatMatch()
        Dim rng1 As Range
        Dim X
        Set rng1 = Range([b1], Cells(Rows.Count, "B").End(xlUp))
        rng1.Offset(0, 1).Columns.Insert
        With rng1.Offset(0, 1)
            .FormulaR1C1 = "=RC[-1]&""||""&R[1]C[-1]"
            X = .Value2
            .EntireColumn.Delete
        End With
        If IsError(Application.Match([a1].Value & "||" & [a2].Value, X, 0)) Then
            MsgBox "No match", vbCritical
        Else
            MsgBox "Match starting at " & rng1.Cells(1).Offset(Application.Match([a1].Value & "||" & [a2].Value, X, 0) - 1, 0).Address(0, 0)
        End If
    End Sub
    

    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 a fairly efficient way to detect syllables in a word.
I need to find the most efficient way of matching multiple regular expressions on
I can't seem to find a more efficient way to copy an embedded resource
I am interested to find out what is the best/fastest (most efficient) way to
I'm trying to find out the most efficient (best performance) way to check date
I'm trying to find an efficient deterministic way of allocating a 32-bit handle in
For testing purposes, I need to find two 64-bit integer values that exactly multiply
I need to find attribute values in an ASPX file using regular expressions. That
i'm trying to find an efficient way to find a subportion of a large
I need to find the most efficient way to insert a value into table

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.