我想使用excel vba在所用范围内的所有单元格的公式中查找sheetname,并将sheetname替换为另一个sheetname . 要替换的工作表名称新工作表名称分别保存在单元格(如A1和A2)中 .
有类似的帖子,但只是不一样 .
你为什么不用简单的Excel Search and Replace 例程?
Search and Replace
选择您需要处理的范围 .
Go Home 功能区> Find & Select > Replace... 或只需按CTRL H.
Home
Find & Select
Replace...
使用相应的工作表名称填写两个字段,但在案例表名称中包含 do not forget 前导和尾随 ' 符号 spaces .
'
按 Replace All ,你就完成了 .
Replace All
如果您别无选择,只能使用VBA - 请关注@Tim W.建议并使用宏录制器记录上述步骤 . 祝好运!
1 回答
你为什么不用简单的Excel
Search and Replace
例程?选择您需要处理的范围 .
Go
Home
功能区>Find & Select
>Replace...
或只需按CTRL H.使用相应的工作表名称填写两个字段,但在案例表名称中包含 do not forget 前导和尾随
'
符号 spaces .按
Replace All
,你就完成了 .如果您别无选择,只能使用VBA - 请关注@Tim W.建议并使用宏录制器记录上述步骤 . 祝好运!