Solved

compare excel values, not the formula

Posted on 2011-03-21
2
320 Views
Last Modified: 2012-08-13
Hi,

Ive got an excel macro that compares 2 sources (sheet 1 as source 1, sheet 2 as source 2). The problem Im having is that Im pulling the data from both sources using the same formula in both sheets and when my macro tries to compare it says there are no differences even though the values in the cells are different (the formula to derive the value in the cell is the same)

Ive attached the macro as a file

Cheers
macro.txt
0
Comment
Question by:DiCanio13
2 Comments
 
LVL 50

Accepted Solution

by:
Dave Brett earned 500 total points
ID: 35186496
Rather than

cf1 = ws1.Cells(r, c).FormulaLocal
cf2 = ws2.Cells(r, c).FormulaLocal

try this

Dave

cf1 = ws1.Cells(r, c).Value
cf2 = ws2.Cells(r, c).Value

Open in new window

0
 

Author Closing Comment

by:DiCanio13
ID: 35186598
Cheers thats great
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now