Excel简体繁体转换的VBA代码
发布时间: 2021-12-13 来源: 网络 编辑: word12345.com 阅读: 0 关键词: Excel教程

在Excel中,没有简体和繁体文字之间的转换功能。

但是Word却有此功能,因此,我们可以在Excel中通过VBA代码调用Word的繁体和简体功能,实现在Excel中的简体繁体转换的功能。

下面就是与此相关的VBA代码,希望对你有帮助。

Sub JFZH()

Dim wd As Word.Application

Set wd = New Word.Application

With wd.Documents.Add .Sections(1).Range.Text = Sheet1.Cells(1, 1).Text ' .Sections(1).Range.Select 'wd.WordBasic.ToolsSCTCTranslate Direction:=0, Varients:=0, TranslateCommon:=0

wd.WordBasic.ToolsTCSCTranslate Direction:=0, Varients:=0, TranslateCommon:=0 '繁体转简体

Sheet1.Cells(1, 1) = .Sections(1).Range.Text .Close False'简体转繁体

End With wd.Quit

Set wd = Nothing End Sub

热门教程

点击排行

最新教程