Microsoft Office Tutorials and References
In Depth Information
Figure 19-9. Sheet1 after consolidation with TopRow set to False
"Sheet3!R1C1:R3C3"), Function:=xlSum
will produce the results shown in Figure 19-9 (on Sheet1).
Figure 19-9. Sheet1 after consolidation with TopRow set to False
On the other hand, setting the TopRow property to True :
Worksheets("Sheet1").Range("A1").Consolidate _
Sources:=Array("Sheet2!R1C1:R3C3", _
"Sheet3!R1C1:R3C3"), Function:=xlSum, _
TopRow:=True
produces the results shown in Figure 19-10 , since the data is combined based on the names in the
first row.
Figure 19-10. Sheet1 with TopRow set to True
19.3.15 Copy and Cut Methods
As applied to the Range object, the Copy method has the syntax:
RangeObject .Copy( Destination )
where Destination is a Range object that specifies the new range to which the specified range
will be copied. If this argument is omitted, Excel will copy the range to the Clipboard. For
instance, the code:
Range("A1:C3").Copy Range("D5")
copies the range A1:C3 to a range of like size whose upper-left corner is cell D5. Note that the
same rules apply here as when copying using Excel's user interface. In particular, if the destination
is more than a single cell, then it must have the same dimensions as the source range or else an
error will occur.
The Cut method has similar syntax:
RangeObject .Cut( Destination )
and cuts the range rather than copying it.
 
 
 
 
Search JabSto ::




Custom Search