回复 1# 邪恶海盗
网络上淘来的,供参考:
;wps表格转置
Dim $app=ObjGet('','wps.application')
Dim $table
with $app.selection.tables
if .count>0 Then
$table=.item(1)
Else
MsgBox(0,'未选择表格','即将退出',5)
Exit
EndIf
EndWith
Dim $et
SplashTextOn("稍候!",'正借用 金山表格装置功能',300,100)
With $table
.range.copy()
$et=ObjCreate('et.application')
$et.visible=-1
$et.workbooks.add
EndWith
With $et
.activesheet.paste() ;到et
.Selection.Copy
.Cells(.Selection.Rows.Count + 1, 1).PasteSpecial(-4104, -4142, False, true) ;转置
.CutCopyMode = 0
.Selection.Copy
$tbRng=$table.range
$table.delete
$tbRng.paste() ;到wps
.CutCopyMode = 0
.activeworkbook.close(false)
.quit()
SplashOff()
EndWith |