比如讀取D:\稅金.xls中sheet1中A1:B20的數據
dim i as integer
application.screenupdating=false
for i=1 to 20
activesheet.cells(i,1).formula="='D:\[稅金.xls]sheet1'!$A$" & i
activesheet.cells(i,2).formula="='D:\[稅金.xls]sheet1'!$B$" & i
next i
activesheet.range("a1").currentregion.copy
activesheet.range("a1").PasteSpecial xlPasteValues
Application.CutCopyMode = False
application.screenupdating=true
運行一下后,發(fā)現比打開、讀取、關閉的操作快多了,特與大家分享。
聯系客服