2014-12-03 2 views
-1

그래서 특정 매크로를 지우는 간단한 매크로가 있습니다. 그것은 잘 작동하고 텍스트 상자를 통해 입력을 소요하는 userform을 추가하고 그것을 지우려면 마지막 줄 TextBox1.Value = ""를 추가했습니다. 이제 매크로를 실행하는 버튼을 클릭하면 상자가 지워지지만 424 오류가 발생합니다. 나는 그것의 기본적인 무언가를 간과하고있다, 구문 또는 일부 폐지 논쟁이다. 어떤 도움을 주시면 감사하겠습니다.오류 424 - Excel 매크로에서 필요한 개체

Sub Clear() 
' 
' Clear Macro 
' 

' 
Range("A1").Select 
Selection.ClearContents 
Range("H17").Select 
Selection.ClearContents 
Range("H11").Select 
Selection.ClearContents 
Range("B1").Select 
Selection.ClearContents 
Range("I4").Select 
Selection.ClearContents 
Range("K4").Select 
Selection.ClearContents 
Range("M4").Select 
Selection.ClearContents 
Range("H10").Select 
Selection.ClearContents 
Range("H16").Select 
Selection.ClearContents 
TextBox1.Value = "" 
End Sub 
Sub notebutton1_Click() 
Range("K8").Select 
Selection.Copy 
End Sub 
Sub notebutton2_Click() 
Range("K13").Select 
Selection.Copy 
End Sub 
Sub notebutton3_Click() 
Range("K18").Select 
Selection.Copy 
End Sub 
+1

강조 무슨 라인 우리에게 말하고에 대해 당신은 어떻게받을 때 오류? –

+0

당신의 오류가 다른 곳에서 나타나는 것 같기 때문에 전체 코드를 게시하십시오 ... –

답변

0

TextBox1.Value는 = ""가에 살고 형태 동반되어야한다. 예를 Userform1.TextBox1.Value = 이처럼 ""

+0

고마워요. 정확히 그랬습니다. – Michael

+0

@Michael 아직 작성하지 않았다면 http://stackoverflow.com/help/accepted-answer를 참조하십시오. – pnuts

관련 문제