Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

compare excel values, not the formula

Posted on 2011-03-21
2
Medium Priority
?
333 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 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
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…

824 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