excel - 如何在有动态输入和动态输出的地方重复“替换”命令?
问题描述
我正在尝试替换 625 个方程中的系数。
我正在尝试替换
- x(2) 与 x(1)
- x(3) 与 x(2)
- …</li>
- x(625) 与 x(624)
这是我的代码。
Sub FindReplaceAll()
Dim sht As Worksheet
Dim fnd As Variant
Dim rplc As Variant
'To Replace the x(2) with x(1) and x(2) with x(1) and .... x(625) with x(624)
For k = 2 To 625
fnd = "x(k)"
rplc = "x(k-1)"
For Each sht In ActiveWorkbook.Worksheets
sht.Cells.Replace What:=fnd, Replacement:=rplc, _
LookAt:=xlPart, SearchOrder:=xlByRows,
MatchCase:=False, _
SearchFormat:=False, ReplaceFormat:=False
Next sht
Next k
End Sub
解决方案
推荐阅读
- python - 如何使用 Pandas 中的两个标准清理或平滑时间序列
- java - 将我的应用程序发布到 google playstore 后,我的应用程序无法获取 firestore 数据以回收分页视图
- c# - 更新特定目录中的图像文件
- python - 当用户尝试再次运行它时,如何在任务栏中最大化或激活打开的应用程序窗口?
- provider - 如何在 Monaco 编辑器中进行智能类型感知代码完成?
- salesforce - 使用 Azure 数据工厂将数据从 Azure SQL Server 复制到 Salesforce
- r - 为什么 read.csv 得到错误的类?
- function - 为tradingview编写pinescript函数的问题
- javascript - CSS 和 JS 不再适用于我的 Flask 应用程序
- java - 我可以将自定义字段添加到 liferay 中的帐户创建页面吗?