代码在Word里运行,将Word表格內1行2列的值傳到excel的A1:
Sub test()
Dim oExcelApp As Object, oWk As Object
Dim s
s = ThisDocument.Tables(1).Cell(1, 2)
Set oExcelApp = CreateObject("EXCEL.APPLICATION")
With oExcelApp
.Visible = True
Set oWk = .workbooks.Add
oWk.sheets(1).Range("a1") = Mid(s, 1, Len(s) - 2)
End With
End Sub作者: color790 時間: 2010-10-18 23:02