2014-06-23 4 views
0

다음 코드가 있습니다. 나는 다른 기준으로 필터를 적용하고 있는데 필터에 행이있을 때 작동하지만 "프로퍼티가 프로 시저를 정의하지 못하고 프로퍼티가 프로 시저가 프로 시저를 가져 오지 못해"라인의 "My_Range.Parent"오류가 발생합니다. AutoFilter.Range.Copy "를 선택하십시오.자동 필터 결과가 존재하는 경우 복사/붙여 넣기 매크로

매크로를 계속하려면이 빈 "붙여 넣기"를 어떻게 건너 뛸 수 있습니까? 감사!! 오류 물마루 건너 뛸

My_Range.AutoFilter Field:=14, Criteria1:="=FEDERAL" 
My_Range.AutoFilter Field:=7, Criteria1:="=No" 


    'Copy/paste the visible data to the new worksheet 

    My_Range.Parent.AutoFilter.Range.Copy 
     With Sheets("Federal").Range("c5") 
     .PasteSpecial xlPasteValues 
     .PasteSpecial xlPasteFormats 
     Application.CutCopyMode = False 
     '.Select 
    End With 


End If 

답변

0

쉬운 방법은 작성하는 것입니다 :

On Error GoTo myerrorhandler 'put this line on the beginning of you sub/function 
    ... your code ... 
myerrorhandler: 'after error your code continues to execute from this line 
    .... more of your code... 

또는 당신은 당신을 의미,이 모든 오류 메시지를 표시하지 않습니다 조심, 그런데

On Error Resume Next 'your code will resume to next line of code after the error 
+0

를 작성할 수 이를 구현하기 전에 코드에 다른 오류나 버그가 없는지 확인해야합니다. 디버깅 등을 원할 경우 모든 오류를 "숨길"것입니다. –