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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:13:57+00:00 2026-05-25T16:13:57+00:00

In excel 2010, I have to compare two versions (old, new) of the same

  • 0

In excel 2010, I have to compare two versions (old, new) of the same underlying data

I used arrays to store the old values and the new values and then tried to compare the corresponding values. Where the values are not same, the cell background would become yellow.

Everything works fine till the statement

If vaNewValues(i, j).Value <> vaOldValues(i, j).Value Then

At this statement, I am getting run-time error ‘424’: Object required

Sub File_Comparison()

'Open the old file

OldFN = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls), *.xls", Title:="Please open old file")
Workbooks.Open Filename:=OldFN
End If

'Store the range of cells into an array 'vaOldValues

vaOldValues = Range("b9:r54").Value

'Close old file

ActiveWorkbook.Close False

'Open the new file
NewFN = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls), *.xls", Title:="Please open new file")
Workbooks.Open Filename:=NewFN

'Store the range of cells into an array 'vaNewValues
vaNewValues = Range("b9:r54").Value

'i= row
'j=column

For i = 1 To UBound(vaNewValues, 1) 'max row number
For j = 1 To UBound(vaNewValues, 2) 'max column number


*If vaNewValues(i, j).Value <> vaOldValues(i, j).Value Then*

Range("b9:r54").Cells(i, j).Interior.Color = 65535

End If

Next j
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-05-25T16:13:57+00:00Added an answer on May 25, 2026 at 4:13 pm

    Working with arrays is not the same as ranges, try this instead to access the value in the array

    If vaNewValues(i, j) <> vaOldValues(i, j) Then
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a new Excel 2010 Add-in project, with VS10. When I run
Using Excel 2010 and SQL Server 2008 R2. I used import and export data
I am using Memory-stream to write my data into Excel (used Unicode8F),however i have
In Excel 2010, I have a list of values in column A and a
I am using Excel 2010. I have a monthly data table that looks similar
I have an Excel 2010 workbook. I need to save the used range of
I have two copies of an Excel 2010 spreadsheet, my copy for editing and
I have an Excel 2010 workbook for financial records. On one worksheet, I have
I have the following function using Excel 2010: Private Function MakeAllSheetsValuesOnly(targetBookName As String) If
In a cell in Excel sheet I have a Date value like: 01/01/2010 14:30:00

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.