• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Calculating variances between two sheets and populating results in third sheet

Macro newbie

New Member
Hello Ninjas

First up, thank you in advance for your assistance!
I have been attempting this for almost a week now and am at a complete loss as to how to proceed, so any assistance will be greatly appreciated.

I need a code that will achieve the below:

a) Calculate the difference between the JAN sheet and FEB sheet
b) Populate the results in VARIANCE sheet
c) If a row or column exists in one sheet but not in the other sheet, I need the code to be able to create the new row and/or column in the VARIANCE sheet and do the calculation
d) I have attached a sample sheet that shows what I need

I tried using MATCH/INDEX and VLOOKUP but because they make reference to row and column numbers, as soon as I try to duplicate the calculations where the row and/or column numbers are not the same in the two sheets, then my results come out all wrong.

Please let me know if you need me to clarify further.

Many thanks,
Macro newbie
 

Attachments

  • VBA.xlsx
    11.3 KB · Views: 3
Many thanks for your response Hui. Greatly appreciated.

Is there any way I can run the code without testing for column and row additions? So just generate a report with variances? Then I will manually manipulate the row and column additions.

Many thanks,
Macro Newbie
 
But if that us all you want
On a third sheet
A1: =Sheet1!A1=Sheet2!A1

Copy across and down

Look for all the False value
That is where the sheets aren't equal
 
Back
Top