本帖最后由 skeytsao 于 2018-7-1 17:00 编辑
各位先进烦请帮帮我,我的问题是,我在excel写了一个宏(台湾称为巨集),如下
Sub 最后列() DimmyRange As Range SetmyRange = ThisWorkbook.Sheets(1).Range("J65536").End(xlUp) '表示在B栏的最后一列 myRange.Select SetmyRange = Nothing
Selection.Copy End Sub
我要如何修改才能将excel的 Selection.Copy 连结在我在word的宏中,将"R45"改成,我在excel的复制内容(它是变量),谢谢各位!
'word 工作02宏 Sub 工作02 宏()
Selection.WholeStory Selection.Fields.ToggleShowCodes Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting WithSelection.Find .Text= "R10" .Replacement.Text= "45" .Forward = True .Wrap= wdFindContinue .Format = False .MatchCase= False .MatchWholeWord = False .MatchByte = True .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms= False End With End Sub
|