我尝试将信息从一个Excel工作簿复制并粘贴到另一个工作簿中。两者都已打开,当它到达最后一行代码时出现错误:
Sub FCWKBKCOPY()
'
' FCWKBKCOPY Macro
'
'
Workbooks.Open Filename:= _
"C:\Users\Dan\Desktop\Workbook Macro\FWB_17_PR000022192_CDP Financial and Portfolio 1_04+08.xlsm"
Sheets("FORECAST").Select
If ActiveSheet.AutoFilterMode = True Then
ActiveSheet.AutoFilterMode = False
End If
Columns("E:DT").Select
Selection.Copy
Application.Workbooks("ForecastWorkbook_Scrape.xlsm").Activate
我得到的错误是
运行时错误' 9':
下标超出范围
两个工作簿都是开放的,导致此错误的原因是什么?