如何用excel宏替换某列中的几个内容?

如题所述

鼠标移至工作表标签名处,右键,查看代码,将下列代码粘贴进去\x0d\x0aSub 替换()\x0d\x0a For i = 1 To [H65536].End(xlUp).Row\x0d\x0a Cells(i, 8).Replace What:="beijing", Replacement:="北京"\x0d\x0a Cells(i, 8).Replace What:="shanghai", Replacement:="上海"\x0d\x0a Cells(i, 8).Replace What:="xinjiang", Replacement:="新疆"\x0d\x0a Cells(i, 8).Replace What:="", Replacement:="江西"\x0d\x0a Next\x0d\x0aEnd Sub\x0d\x0a退出VB窗口,ALT+F8,运行替换宏。
温馨提示:答案为网友推荐,仅供参考
相似回答
大家正在搜