运行时错误1004-复制所选工作表失败

时间:2018-10-10 18:34:11

标签: excel vba worksheet

我正在尝试为同事修复此错误,但是对代码工作极为生锈。

Sub SelectPricingSheet() 
'Copy userform1 selected Pricing sheet after Import Sheet.

    CreateSheetList                    ' Subroutine: Build list of Price sheets
    Load UserForm1                     ' Load form to select price sheet
    UserForm1.Show                     ' Show form to select price sheet

    If SelectedSheet <> "" Then        ' Test no selected sheet
        Sheets(SelectedSheet).Copy After:=Sheets("Import") 'Copy selected sheet after Import Sheet
    Else
    End If                              ' No processing
End Sub

此行出现错误。

Sheets(SelectedSheet).Copy After:=Sheets("Import")          ' Copy selected sheet after the Import Sheet

0 个答案:

没有答案