SourceBook = ActiveWorkbook.Name
SourceSheet = Workbooks(SourceBook).Worksheets(2).Name
If Workbooks(SourceBook).Sheets(SourceSheet).Range("B10") = "SM" Then
Workbooks(SourceBook).Worksheets(SourceSheet).Range("D11:D3000,K11:K3000,N11:AC3000,CX11:CX3000,DD11:DD3000").Select
Selection.Copy
当我在上面输入代码时,我得到了结果。但后来,当我输入代码时,
ElseIf Workbooks(SourceWorkbook).Sheets(SourceSheet).Range("B1") = "Status" Then
MsgBox ("okay....")
表明"Subscript out of range (Error 9)".
有人可以帮忙吗?