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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:20:53+00:00 2026-06-13T13:20:53+00:00

I am trying to check whether the values in workbook1-sheet1-A are matched in workbook2-sheet2-E

  • 0

I am trying to check whether the values in workbook1-sheet1-A are matched in workbook2-sheet2-E. If there is a match workbook1-sheet1-Y receives a 'x'.

This is the code I have so far and gives me Run time error 424 - Object required error on the if loop.

Sub Check()
'
Application.ScreenUpdating = False

endRow = Range("A" & Rows.Count).End(xlUp).Row

wkbSLA = ("F:\Workbook2")

For i = 2 To endRow
    If Cells(i, 1).Value = wkbSLA.Sheets("Sheet2").Range("E2:E575").Value Then
        Range("Y" & i) = "x"
    End If
Next i

'
End Sub
  • 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-13T13:20:54+00:00Added an answer on June 13, 2026 at 1:20 pm

    To ensure your code is doing everything you expect it to it, make sure you qualify your objects with variables.

    Also, you cannot use the .Value property on multi-cell range. That is probably where your error is hitting. A better way to approach this is with the .Find method.

    If you write the code something like this, it should work for you … though you may need to tweak it a bit to meet your needs.

    Option Explicit
    
    Sub Check()
    
    Application.ScreenUpdating = False
    
    Dim wkb1 as Workbook, wkb2 as workbook
    Set wkb1 = Workbooks("workbook1")
    Set wkb2 = Workbooks("F:\Workbook2") 
    ' -> do you need Workbooks.Open("F:\Workbook2") here? 
    ' Seems you may if the workbook you want to access is closed
    
    Dim wks1 as Worksheet, wks2 as Worksheet
    Set wks1 = wkb1.Sheets(1) 'may need to change this reference for your needs
    Set wks2 = wkb2.Sheets("Sheet2")
    
    With wks1
    
        Dim endRow as Long
        endRow = .Range("A" & Rows.Count).End(xlUp).Row
    
        Dim i as Long
        For i = 2 To endRow
    
            Dim rng as Range
            Set rng = wks2.Range("E2:E575").Find .Cells(i,1).Value lookat:=xlWhole
    
            If Not rng Is Nothing Then .Range("Y" & i) = "x"
    
        Next i
    
    End With
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to check whether an NSInteger is odd or even. I
can anyone help me in trying to check whether JavaScript is enabled in client
I am trying to find the fastest way to check whether a given number
I am trying to make an if statement which will check whether the users
I am trying to check a series of buttons to see if they have
I'm trying to check if a file exists. If I use this: NSData *data
I'm trying to check whether val() has a specific value or not inside a
I'm trying to check whether a URL is from the same domain with jQuery
So this question is two parts. The first is seeing whether there is a
I'm trying to check whether a list of items contain specific number in the

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.