excel - 没有附加到该表的应对代码的重复表
问题描述
我对您建议的删除代码的代码有疑问。我想删除重复工作表“Overview 10 years (2)”中 Excel 对象上激活的所有代码,这样我就可以继续运行而不会干扰其他代码。我做这件事的方式有什么遗漏吗?
Sheets(Array("Overview 10 years", "Overview monthly")).Select
Sheets("Overview 10 years").Activate
Sheets(Array("Overview 10 years", "Overview monthly")).Copy Before:=Sheets(1 _
)
Sheets("Overview 10 years (2)").Activate
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
' Get the code/object name of the new sheet...
Dim StrObjectName As String
StrObjectName = Sheets("Overview 10 years (2)").CodeName
' Remove all lines from its code module...
With ThisWorkbook.VBProject.VBComponents(StrObjectName).CodeModule
.DeleteLines 1, .CountOfLines
End With
我需要删除第 1-15 行,以便它不再干扰其他代码。
解决方案
推荐阅读
- c# - Redis 无法从 IIS 连接
- sql-server - 部署到服务器时 SSIS Power Query 数据源 Web API 提取错误
- sql - 如何删除嵌套 psql 数组中的 jsonb 项
- python - 如何在 scikit learn 中创建评分函数以考虑其他辅助变量?
- r - R中的线性回归库
- java - 在 Docker 中运行 Selenium 找不到 geckodrvier.exe
- reactjs - React 根据数组长度有条件地返回映射的引导元素
- asp.net - HttpPatch 未更新 .NET Core 中的数据
- amazon-redshift - AWS Redshift:致命:非引导用户超出连接限制“500”
- c# - log4net 无法创建日志文件