- UID
- 10108
- 积分
- 5956
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-9-17
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
AutoFill 方法
请参阅 应用于 示例 特性
对指定区域中的单元格进行自动填充。Variant 类型。
expression.AutoFill(Destination, Type)
expression 必需。该表达式返回“应用于”列表中的对象之一。
Destination Range 对象类型,必需。要填充的单元格。目标区域必须包括源区域。
Type XlAutoFillType 类型,必需。指定填充类型。
XlAutoFillType 可为以下 XlAutoFillType 常量之一。
XlAutoFillType的选项: Name | Value | Description | xlFillCopy | 1 | Copy the values and formats from the source range to the target range, repeating if necessary. | xlFillDays | 5 | Extend the names of the days of the week in the source range into the target range. Formats are copied from the source range to the target range, repeating if necessary. | xlFillDefault | 0 | Excel determines the values and formats used to fill the target range. | xlFillFormats | 3 | Copy only the formats from the source range to the target range, repeating if necessary. | xlFillMonths | 7 | Extend the names of the months in the source range into the target range. Formats are copied from the source range to the target range, repeating if necessary. | xlFillSeries | 2 | Extend the values in the source range into the target range as a series (for example, '1, 2' is extended as '3, 4, 5'). Formats are copied from the source range to the target range, repeating if necessary. | xlFillValues | 4 | Copy only the values from the source range to the target range, repeating if necessary. | xlFillWeekdays | 6 | Extend the names of the days of the workweek in the source range into the target range. Formats are copied from the source range to the target range, repeating if necessary. | xlFillYears | 8 | Extend the years in the source range into the target range. Formats are copied from the source range to the target range, repeating if necessary. | xlGrowthTrend | 10 | Extend the numeric values from the source range into the target range, assuming that the relationships between the numbers in the source range are multiplicative (for example, '1, 2,' is extended as '4, 8, 16', assuming that each number is a result of multiplying the previous number by some value). Formats are copied from the source range to the target range, repeating if necessary. | xlLinearTrend | 9 | Extend the numeric values from the source range into the target range, assuming that the relationships between the numbers is additive (for example, '1, 2,' is extended as '3, 4, 5', assuming that each number is a result of adding some value to the previous number). Formats are copied from the source range to the target range, repeating if necessary. |
如果省略本参数或将本参数指定为 xlFillDefault,则 Microsoft Excel 将依据源区域选择最适当的填充方式。
示例
本示例以工作表 Sheet1 上的单元格区域 A1:A2 为基础,对单元格区域 A1:A20 进行自动填充。运行本示例之前,请在单元格 A1 中键入 1,在单元格 A2 中键入 2。
Set sourceRange = Worksheets("Sheet1").Range("A1:A2")
Set fillRange = Worksheets("Sheet1").Range("A1:A20")
sourceRange.AutoFill Destination:=fillRange
以上是 VBA Help,Acad 中 ActiveX 代码如下
|
|