jeudi 9 février 2017

VBA - using the consolidate function to sum data

Vote count: 0

I am trying to use the consolidate functionality to sum a number of sheets (with the names apples and oranges), with the same template into one master template.

ConsolidateRange is the tab names and the ranges to use in the consolidation.

Master is the name of the sheet that I am trying to output the sum to.

Please see below the code that I am trying to use in order to do this:

ConsolidateRange = """apples!R1C1:R37C6"",""oranges!R1C1:R37C6"""

    Worksheets("Master").Range("A1").Consolidate _
    Sources:=Array(ConsolidateRange), _
    Function:=xlSum

The error that I'm getting is 'Cannot open consolidation source file 'apples'

Any help would be much appreciated.

Thanks

asked 32 secs ago

Let's block ads! (Why?)



VBA - using the consolidate function to sum data

Aucun commentaire:

Enregistrer un commentaire