vba - 公式拖拽查询
问题描述
我正在尝试使用以下代码将公式从一个范围拖到其下一个直接列
Range(Cells(11, lc2), Cells(70, lc2)).AutoFill _
Destination:=Range(Cells(11, lc2 + 1), Cells(70, lc2 + 1)), Type:=xlFillDefault
我面临 1004 错误
请指教
解决方案
您正在使用的列lc2
, 必须包含在目标中,例如
Range(Cells(11, lc2), Cells(70, lc2)).AutoFill _
Destination:=Range(Cells(11, lc2), Cells(70, lc2 + 1)), Type:=xlFillDefault
这意味着您不能仅使用列自动填充lc2+1
推荐阅读
- c# - 从特定列中搜索数据,其中要从中选择的数据按特定列中的重复项排序
- android - 我应该选择的最低 SDK 版本是多少?(如 2019 年 7 月),为什么?
- java - Spring data jpa findOne throwing IncorrectResultSizeDataAccessException exception
- oracle - 基于从多个表计算的值的 Oracle PL/SQL 更新
- java - 如何在使用 CommonsRequestLoggingFilter 处理请求正文之前记录它?
- ibmhttpserver - 我将如何(使用 Web UI)或在哪里(在哪个文件中)在 IBM HTTP Server 中添加 java 选项?
- angular - 将字符串作为 Observable 返回
- pandas - 如何插入行索引 == 'index' 值的行并将其他行向下移动?
- java - Java 数组排序帮助:如何在扫描仪上输入时执行此操作
- java - 如何在不同分辨率的 RCP 应用程序的视图中设置独立视图的高度?