0
我使用下面Excel宏 - 粘貼選擇到Word
iMaxRow = 200
" Loop through columns and rows"
For iCol = 1 To 3
For iRow = 1 To iMaxRow
With Worksheets("GreatIdea").Cells(iRow, iCol)
" Check that cell is not empty."
If .Value = "" Then
"Nothing in this cell."
"Do nothing."
Else
" Copy the cell to the destination"
.Copy Destination:=Worksheets("Sheet2").Cells(iRow, iCol)
End If
End With
Next iRow
Next iCol
上面的代碼的代碼是唯一適用相同的Excel工作表上。我想擴展它,以便粘貼到word文檔中。我認爲這是一件事;
appWD.Selection.PasteSpecial
但問題是,我沒有做出任何選擇。代碼很好,只需要編輯Copy Destination:=Worksheets("Sheet2").Cells(iRow, iCol)
即可。
感謝您的幫助!
如果有人正在尋找進一步的信息,只需看看這裏:http://www.vbaexpress.com/kb/getarticle.php?kb_id=81 – JMax 2011-05-16 12:35:30