The information in this article applies to:
SYMPTOMSIn Microsoft Excel, when you use the Resize method with a range object that has been defined using the Set statement in a Visual Basic procedure, you receive the following error message:
CAUSE
This error message appears when you use the Resize method if you omit the
rowSize argument, and the range that you are resizing is defined as a Range
Object data type. The Resize method requires the rowSize argument when you
use it with a range object that is defined using the Set statement. WORKAROUNDSTo avoid receiving this error message, use either of the following methods:Method 1: Dimension your range object as an Object or Variant data type instead of as a Range Object type as in the following example: Method 2:Use the Count property and the Rows method to determine the number of rows that the current range contains, and use this value as the rowSize argument in the Resize method. Use this method if you don't want to change the number of rows in the range, and you don't know how many rows are contained in the range:
Microsoft provides examples of Visual Basic procedures for illustration
only, without warranty either expressed or implied, including but not
limited to the implied warranties of merchantability and/or fitness for a
particular purpose. This Visual Basic procedure is provided 'as is' and
Microsoft does not guarantee that it can be used in all situations.
Microsoft does not support modifications of this procedure to suit customer
requirements for a particular purpose.
MORE INFORMATIONYou can use the Resize method in a Visual Basic procedure to resize a range. This method has two arguments, rowSize and columnSize. The Visual Basic Reference indicates that both arguments are optional, and that the new range will keep the same number of rows or columns if you omit one of the arguments. However, when you resize a range that is defined as a Range Object data type, you receive an error message if you omit the rowSize argument. REFERENCESFor more information about the Resize Method, choose the Search button in the Visual Basic Reference and type: Resize Method Additional query words: 1.00 5.00c
Keywords : |
Last Reviewed: September 21, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |