VBA将文本从Excel复制到Wordfile中的特定位置 [英] VBA to copy text from excel to on specific location in wordfile
问题描述
问题:将从excel复制的数据粘贴到word文件中的特定位置.
Problem: Pasting copied data from excel to specific location in a word file.
目前,我有可以粘贴该值的代码,但是可以粘贴到"paragraph1"
Currently I have code which can paste the value, but it does so to "paragraph1"
myDoc.Paragraphs(1).Range.Paste
如何指定粘贴数据的确切位置(按行)? 让我知道是否需要更多信息.
How do I specify the exact location (by line) in which to paste the data? Let me know if more info is required.
谢谢!
阿赫达(Mohd Akhtar)
Mohd Akhtar
推荐答案
您还可以使用一些书签:
You could also use some bookmarks:
您可以选择放置书签的位置,然后在上面这样写
ThisDocument.Bookmarks("NAME_OF_THE_BOOKMARK").Range.Text = THE_EXCEL_DATA
You can choose where you put your bookmark and then write on it like this
ThisDocument.Bookmarks("NAME_OF_THE_BOOKMARK").Range.Text = THE_EXCEL_DATA
要放置书签,您必须单击所选区域,然后继续插入->书签,然后命名.
To place a bookmark you have to click on the selected area and then go on Insert->Bookmarks and then name it.
这篇关于VBA将文本从Excel复制到Wordfile中的特定位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!