我想使用 2 列中的值在 excel 范围内的多个值上运行查找和替换:A 与原始单词;B 与翻译。我已经找到了 VBA 代码来让它工作 50%,但是这段代码在整个工作表上运行它。
理想情况下,我希望能够在我选择的范围内运行它。如果我还可以选择查找范围,那将是一个额外的好处。
这就是我目前使用的。谢谢你的帮助!
Sub abbrev()
Dim abvtab() As Variant
Dim ltsheet As Worksheet
Dim datasheet As Worksheet
Dim lt As Range
'Change Lookup to the sheet name with your lookup table.
Set ltsheet = Sheets("Lookup")
'Change Data to the sheet name with your data.
Set datasheet = Sheets("Data")
'Change A2 to the top left cell (not the header) in your lookup table.
'Change B2 to top right cell.
Set lt = …Run Code Online (Sandbox Code Playgroud)