Returns a reference moved by the specified number of rows and columns
CXlOper Offset( long nRows, long nCols ) const; |
Number of rows to move by (negative is up, positive is down).
Number of columns to move by (negative is left, positive is right).
Returns a new reference, offset from this reference by the specified number of rows and columns. The function will throw an exception if the new reference is not valid.
The function will throw an exception of type CXlBadOperTypeException if the object does not contain a single or multiple reference.
The function will throw an exception of type CXlOutOfRangeException if the new position would be out of range.
This method is a short-hand for getting a reference, moving it, and setting it. Thus, the following:
xlo2 = xlo1.Offset(0, 1);
is a short-hand for:
xlo2 = xlo1; CXlRef xlr = xlo2.GetRef(); xlr.MoveBy(0, 1); xlo2.SetRef(xlr);
Header: xllplus.h
CXlOper Class | CXlOper Methods | CXlOper::Resize() | CXlOper::MoveRefBy()